![]() |
check vpn status
I'm trying to check the status of a vpn connection. The script below works from the console, but fails from crontab. ???
Thanks for any help. Code:
#!/bin/bash |
Silly question but do you run it from crontab with root permissions?
Have you checked /var/log/syslog for this job, did the job run at all, or did it fail? jlinkels |
Quote:
|
Did you try setting 'suid' bit for /usr/bin/pon? Perhaps, that should help.
If not, the other simple way of doing this is, run the script in an infinite loop with proper sleep. So the script will be running all the time doing things for you. |
Quote:
|
If /usr/bin/pon is a script, it is better to call explicitely /bin/bash /usr/bin/pon. In general, use an absolute path on everything in cron.
Did you set rwxr-xr-x permissions for /usr/bin/pon? If not, even root cannot execute it. (Just guessing, too lazy to try it) Anyway, I have stopped by calling scripts depending on #!/bin/bash or #!/bin/sh on the first line. Just call a script with /bin/bash so you are sure that (a) bash is used to execute and (b) you don't have to discover that you forgot execute permissions. jlinkels |
| All times are GMT -5. The time now is 09:43 PM. |