How to execute Linux shell script with inttab file : I created a shell script with the following content.


    
    #!/bin/bash
    TMP_FILE=/tmp/inet_up
    no_inet_action(){
    reboot
    }
    HOUR="$(date +'%H')"
    if [ $HOUR -le 22 -a $HOUR -ge 9 ]; then
    if ping -c5 192.168.7.100; then
    echo "Internet OK">$TMP_FILE
    else
      echo "No Internet">$TMP_FILE
      no_inet_action
    fi
    fi
    
 

It will ping an IP address during 09:00 to 22:00 and if no internet connection it will write a line to a file and reboot the device. I put the following line in inittab and expect that it will run every 5 minutes interval. I don't see the file in /tmp folder. The script is executable. What is the right way to execute it? I saw some blog suggest to put it under /etc/init.d, which is right way?

inittab is located in /etc/ folder.

   
    
        ::respawn:/sbin/delayexec 600 /etc/check_inet.sh
    
  

