sify autodialer – with expect tools
1] command to start Sify internet connection automatically
root@indiangnu.org:~# cat /usr/local/bin/sify_autodialer
#!/bin/bash
/usr/bin/sifyconnect -o
/etc/init.d/sifybb stop
sifyd
/etc/sify/sifyautoconnect
/usr/bin/sifyconnect –info
root@indiangnu.org:~#
2] Modify sify configuration file
root@indiangnu.org:~# head -n 5 /etc/sify/sifyautoconnect
#!/usr/bin/expect -f
#
# This Expect script was generated by autoexpect
# Expect and autoexpect were both written by Don Libes, NIST.
#
…..
….
…..
root@indiangnu.org:~# tail /etc/sify/sifyautoconnect
#
############################
#Add below line at the end of
set timeout -1
spawn /usr/bin/sifyconnect -l
match_max 100000
expect -exact “username :”
send — “myusername\r”
expect -exact “password :”
send — “mypassword\r”
expect eof
############################
root@indiangnu.org:~#
Similar Posts:
- Automate script for hp_ltt with read option
- Want interactive command in non-interactive mode? – use expect !!
- Load Balancing for sharing multiple internet connections
- How to change password – non interactively in simple way
- Load Balancing – shell script
- BASH Scripting ~ learning by examples
- Bash Scripting ~ เรียน รู้ จาก ตัวอย่าง