Configure sifyconnect on linux- Auto Connectivity

Following steps will give you sify client on linux, working with an automatic connectivity, you need to be root.

  1. Create a directory where we will be keeping sifyconnect related files or scripts.
    mkdir /usr/src/sify
  2. Change directory
    cd /usr/src/sify
  3. Download sifyclient from http://thegoan.com/supersify/
    wget http://thegoan.com/supersify/supersify.zip
  4. unzip downloaded sify client.
    unzip supersify.zip
  5. 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

  6. 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

  7. chmod the script
    chmod 700 /usr/bin/sifyconnect
  8. To check the internet connectivity create one more script, f.e. /usr/bin/sifychk#!/bin/bash
    #
    #to check the internet connection

    ping -c 4 google.com

    if [ "$?" -ne 0 ];then
    /usr/bin/sifyconnect -c
    else
    exit
    fi

  9. chmod 755 /usr/bin/sifychk
  10. 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.

About anuj

Don't go for looks; they can deceive. Don't go for wealth; even that fades away. Go for someone who makes you smile because it takes only a smile to make a dark day seem bright.
This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>