Article 5PV48 Shell script fails when running in cron

Shell script fails when running in cron

by
roffeboffe
from LinuxQuestions.org on (#5PV48)
Hi

This scripts works fine when ran from command line:

Quote:
#!/bin/sh
export PASSWD=duhmmy-password
killall -9 openconnect
sleep 3
nohup echo $PASSWD | openconnect --protocol=gp --user rosc vpngateway.mycomp.com &
As stated, this works perfectly when running from command line, but it doesn't work when putting it into this cron job:

Quote:
0 */12 * * * /root/vpn-up.sh
Any tips?

Running on an old rasperry pi. Purpose is to have an always on network monotoring screen at home, but our firewall drops the vpn connection after 24 hours.latest?d=yIl2AUoC8zA latest?i=nzpharZU3aY:B4YAvZWyXK4:F7zBnMy latest?i=nzpharZU3aY:B4YAvZWyXK4:V_sGLiP latest?d=qj6IDK7rITs latest?i=nzpharZU3aY:B4YAvZWyXK4:gIN9vFwnzpharZU3aY
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments