nico13
March 5th, 2014, 08:00 PM
Hello everyone,
I started writing a script which stop rtorrent, start vpn connection and restart rtorrent if my public ip is 123.456.789.000 (like below)
Each time I test the script, I get this error
xbmc@xbmc:~/Scripts$ sudo bash checkip.sh
checkip.sh: line 14: syntax error: unexpected end of file
so this is my script, can you help me please ?
#!/bin/sh
if [ $curl ifconfig.me/ip == 123.456.789.000 ] && if [ $curl ifconfig.me/host == abc13-3-123-456-789-000.fbx.proxad.net ]; then
sudo service rtorrent-init stop;
wait
cd /etc/openvpn && sudo openvpn "my file.ovpn";
wait
sudo service rtorrent-init start;
fi
I started writing a script which stop rtorrent, start vpn connection and restart rtorrent if my public ip is 123.456.789.000 (like below)
Each time I test the script, I get this error
xbmc@xbmc:~/Scripts$ sudo bash checkip.sh
checkip.sh: line 14: syntax error: unexpected end of file
so this is my script, can you help me please ?
#!/bin/sh
if [ $curl ifconfig.me/ip == 123.456.789.000 ] && if [ $curl ifconfig.me/host == abc13-3-123-456-789-000.fbx.proxad.net ]; then
sudo service rtorrent-init stop;
wait
cd /etc/openvpn && sudo openvpn "my file.ovpn";
wait
sudo service rtorrent-init start;
fi