Save as viaTalkSetCallForward or any other name as desired. From command line: viaTalkSetCallForward 19521234567 mySecretPassword 19529876543 #!/bin/bash # #$1 = Login name #$2 = Password #$3 = Forward number if [ "$1" = "" ]; then echo -e "$0\n Usage: $0\n" exit 1 fi curl -b /tmp/$1.cookie -L "https://support.viatalk.com/billing/user.php?op=menu&tile=callforward" >/tmp/$1-forward.html 2>/dev/null result=`cat /tmp/$1-forward.html|grep callforward|head -1` if [ "$result" = "" ]; then curl -c /tmp/$1.cookie -d "op=login&submit=submit&username=$1&password=$2" -L https://support.viatalk.com/billing/index.php>/dev/null 2>&1 fi if [ "$result" = "" ]; then echo -e "Login Error\n" else curl -b /tmp/$1.cookie -L "https://support.viatalk.com/billing/user.php?op=menu&tile=callforward&number=$1&forward_number=$3" >/tmp/$1-forward.html 2>/dev/null result=`cat /tmp/$1-forward.html|grep -A 6 "name=\"number\" value=\"$1\""|grep "$3"` if [ "$result" = "" ]; then echo -e "Failed to forward $1 to $3\n" exit 1 fi fi exit 0