#!/bin/bash # $Id: startadsl,v 1.13 2005/01/16 22:08:17 Tux Exp $ # Copyright (C) 2003-2005 Olivier Borowski # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Goal : # start ADSL connexion # Params : # h = display help # m = start mire # s = simple mode (don't use ifup & ifdown scripts => do not requiere ifcfg-ethX) # t = set timeout delay (default=60s) # a = use ip adress (use -a xx.xx.xx.xx), imply simple mode # d = launch pppd in debug mode # Error codes : # 1 = pppd already lauched (non degroupé) # 2 = modem can't be synchronized # 3 = can't launch pppd # 4 = can't set modem interface "up" # 5 = eagle-usb must be configured once time # 6 = non pppd users can't use startadsl -m # 7 = modem not operational # the following line will be replaced by the absolute path of setvars . /etc/eagle-usb/setvars # startadsl is lauched manually. If the modem is not operational, # the script is immediately stopped if ! $EAGLESTAT | grep -q "$OPER_STR" ; then doInUtf8 echo -e "$NOT_OPER_MSG" exit 7 fi fctStartAdsl "$@" RES=$? case $RES in 0) # no error occurs, write lock file (used by testconnec) mkdir -p `dirname $SYSCONF_FILE` touch $SYSCONF_FILE ;; 1) doInUtf8 echo -e $ALREADY_MSG ;; 2) doInUtf8 echo -e $CANT_SYNC_MSG ;; 3) doInUtf8 echo -e $PPPD_ERR_MSG ;; 4) doInUtf8 echo -e $IFUP_ERR_MSG ;; 5) doInUtf8 echo -e $LOCK_MSG ;; 6) doInUtf8 echo -e $MIRE_DEG_MSG ;; esac exit $RES #*************************************************************************** # $Log: startadsl,v $ # Revision 1.13 2005/01/16 22:08:17 Tux # - add license header # # Revision 1.12 2005/01/04 21:14:05 Tux # - switch strings to utf-8 # # Revision 1.11 2004/11/11 15:29:10 mcoolive # - improve comments # # Revision 1.10 2004/11/04 23:54:18 mcoolive # - shift error>=7 (exit and comments) for the "6 = modem not operational" # # Revision 1.9 2004/11/04 20:06:10 Tux # - moved error message here (prevent non pppd users to use startadsl -m) # # Revision 1.8 2004/09/16 20:48:24 Tux # - removed useless $SYSCONF_DIR variable # # Revision 1.7 2004/09/15 19:25:03 Tux # - make sure that parent folders of the lock file exist # # Revision 1.6 2004/07/25 20:18:17 Tux # - return error code # - cosmetic changes # # Revision 1.5 2004/07/19 20:44:22 Tux # - startadsl now put lock file (used later by testconnec) # # Revision 1.4 2004/07/16 21:09:47 Tux # - simplify parameters processing # # Revision 1.3 2004/04/21 20:02:27 Tux # *** empty log message *** # #***************************************************************************/