1

I wrote a script that issues a sshuttle command depending on the SSID the computer is connected to and the hour of the day. However, the command does not seem to have any effects in the script. The script is running and the same command works perfectly when run outside the script. The network I connect to is a WPA2 PEAP with MSCHAPv2 as inner authentication. I wonder if the script runs too early and therefore cannot make the ssh connection.

 #!/bin/sh

logger -s "zcallshuttle triggered"
ssid=`iwgetid --raw`
logger -s "SSID found: $ssid"
mac=`iwgetid -a --raw`
ip=`ifconfig $IF | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'`

# python /etc/network/sshvpn $ssid $mac $ip
# I was trying a python script before that has the time constraints

sshuttle_pid=`cat /tmp/sshuttle.pid`
kill $sshuttle_pid
logger -s "issued kill"
sshuttle --dns --daemon --pidfile=/tmp/sshuttle.pid --remote=kaizer@target 0/0>/tmp/vpn.log
# as you can see, I try to get the output of the sshuttle command in /tmp/vpn.log
logger -s "vpn443 called successfully."

/tmp/vpn.log remained empty.

The command works flawlessly when I run it manually.

Ben Kaizer
  • 11
  • 2

0 Answers0