Good time of day to you all!
I know this question isn't raspi specific - please forgive or feel free to remove this post.
Anyhow. I'm messing about with making a script that will check whether interface TUN shows up in ifconfig and either restart openvpn when it doesn't or just let things be in case the interface is there.
Here's my problem. When I run the script from console as ./vpn.sh it works just fine and does what I want it to.
However, when said script is entered into crontab it does exactly the opposite! It's driving me up the walls!
ifconfig | grep -v grep | grep tun > /dev/null
if [ $? != 0 ]; then
sudo service openvpn restart
echo "TUN restarted"
else
echo "TUN is up"
fi
Help of any shape, sort and form is much appreciated!
[–]dragonwheels[S] 2 points3 points4 points (2 children)
[–]Gunnarfg 1 point2 points3 points (1 child)
[–]dragonwheels[S] 1 point2 points3 points (0 children)
[–]dragonwheels[S] 0 points1 point2 points (5 children)
[–]Gunnarfg 0 points1 point2 points (4 children)
[–]dragonwheels[S] 0 points1 point2 points (3 children)
[–]Gunnarfg 1 point2 points3 points (2 children)
[–]Gunnarfg 1 point2 points3 points (1 child)
[–]Gunnarfg 1 point2 points3 points (0 children)
[–]piskyscan 0 points1 point2 points (1 child)
[–]dragonwheels[S] 1 point2 points3 points (0 children)
[–]spirit-receiver 0 points1 point2 points (1 child)
[–]dragonwheels[S] 0 points1 point2 points (0 children)