Following steps will give you sify client on linux, working with an automatic connectivity, you need to be root.
- Create a directory where we will be keeping sifyconnect related files or scripts.
mkdir /usr/src/sify - Change directory
cd /usr/src/sify - Download sifyclient from http://thegoan.com/supersify/
wget http://thegoan.com/supersify/supersify.zip - unzip downloaded sify client.
unzip supersify.zip - I modified the provided ss.sh script just as for my needs, there may be some other method. Just added ‘cd /usr/src/sify’ line as first line to ss.sh.
cd /usr/src/sify
java -jar supersify.jar $*
if [ $? -eq 1 ]
then read
fi - Created a second script to login without providing password every time#!/bin/bash
#
#Change USERNAME, PASSWORD and ETH according to your system and user/pass
#Change ETH with the ethernet card connecting to sify ISP
#mail me: anuj.unix@gmail.com
#Ends.
USERNAME=my_sify_username
PASSWORD=my_sify_password
ETH=eth1
#Get the mac address here
MAC_SIFY=`ifconfig $ETH |grep HWaddr|cut -d ” ” -f 11`
if [ "$#" -ne 1 ];then
echo “To connect: `basename $0` -c ”
echo “To disconnect: `basename $0` -d ”
exit
fi
#Change directory where we unzipped the supersify.zip
cd /usr/src/sify#To connect sify
if [ "$1" = "-c" ];then
/bin/sh ss.sh -u “$USERNAME” -p “$PASSWORD” -m $MAC_SIFY
#To disconnect sify
else if [ "$1" = "-d" ];then
echo “Logging out from sify”
/bin/sh ss.sh -l
else
echo “To connect: `basename $0` -c ”
echo “To disconnect: `basename $0` -d ”
exit
fi
fi - chmod the script
chmod 700 /usr/bin/sifyconnect - To check the internet connectivity create one more script, f.e. /usr/bin/sifychk#!/bin/bash
#
#to check the internet connectionping -c 4 google.com
if [ "$?" -ne 0 ];then
/usr/bin/sifyconnect -c
else
exit
fi - chmod 755 /usr/bin/sifychk
- Add an entry in cron to automatically try to connect in case you are disconnected. Following crontab entry will check the internet connectivity every minute and connect automatically in case of disconnection. Obviously network cable and ISP should be reachable.crontab -e
* * * * * /usr/bin/sifychk >/dev/null 2>&1
That’s it.
Anuj Singh.