Hi guys,
so I want to automatically run a command at boot, but I want OSMC to wait with the command until everything is done. like you already are in OSMC and the internet connection has been established.
I want to run the command pppd pty "pptp IP_OF_SERVER --nolaunchpppd" file /etc/ppp/options.pptp user USERNAME password PASSWORD at boot, like I said, after everything is done.
I’m not a linux guru, and I tried putting it in /etc/rc.local
this is how my /etc/rc.local looks like:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
pppd pty "pptp IP_OF_SERVER --nolaunchpppd" file /etc/ppp/options.pptp user USERNAME password PASSWORD
exit 0
I have tested the command, and by itself, it works
What I would do is add the command as a cron job with a delay. So, access crontab with sudo crontab -e. At the end of the file add the line: @reboot sleep 60 && your_command
This command runs 60 seconds after every reboot. Hopefully 60 seconds is long enough to have the internet connection established, if not just increase it further.
If you run crontab -e as root (which you are by using sudo) then you are editing root’s crontab. As such you do not need to put sudo in your crontab entry.
It should be:
sudo crontab -e
not sudo nano crontab -e, by the way.
Also always provide the full path to your executable in crontab files - for example: