If you are using adsl ....
You can use the commands adsl-start adsl-stop and adsl-status
To configure the connection use adsl-setup
They are installed with rp-pppoe package, and run as root
To allow any user connect/disconnect add these lines to /etc/sudoers
Code:
# Create ADSL alias for the adsl commands
Cmnd_Alias ADSL = /usr/sbin/adsl-start, /usr/sbin/adsl-status, /usr/sbin/adsl-stop
# Allow all users run the adsl commands without a password
ALL ALL = NOPASSWD: ADSL
Then any user can run the commands using sudo (run as root), eg "sudo adsl-start"
The simplest thing is to create aliases in your .bashrc such as these
Code:
alias adslstart='sudo adsl-start'
alias adslstatus='sudo adsl-status'
alias adslstop='sudo adsl-stop'
Then you can connect/disconnect with adslstart and adslstop