I am trying to set an auto run on my shell script (named driver_check.sh) which will trigger upon rebooting the driver. Basically, my script is as shown below:#!/bin/bashecho Start script    now=$(date +%T)    LOGFILE_HOME=/var/opt/mydriver/log/startupFail.logecho ======== LOG EVENT CHECKING ======== >> $LOGFILE_HOMEecho DATE: $(date +%Y-%m-%d ) $now >> $LOGFILE_HOMEecho ------------------ >> $LOGFILE_HOMEfor loop in {1..3}do        echo $loop        echo Loop $loop >> $LOGFILE_HOME        now=$(date +%T)        echo Current time : $now        if grep -iq success /var/opt/mydriver/log/driver.log        then             echo ok            break        else            if [ $loop = 3 ]            then                     #send email                    mail -s Fail to restart/reboot myemail@domain.com                    echo Fail                    echo Fail >> $LOGFILE_HOME                    echo An email has sent>> $LOGFILE_HOME            fi          fi          ((loop ++));        sleep 3    doneI have tried adding this line at the beginning of the scriptchmod 755 driver_check.shI have also moved the file to /etc/init.dThe script still do not auto run when I restart the driver. What else should I do to make it works?Really appreciates any advice you guys can offer.P/S: I am completely a newbie in this shell scripting and linux matter. So, please explain like I am an idiot. :(But I am willing to learn :)
How to auto run script upon driver reboot?
shell script;command line;files;drivers