File: startadsl

package info (click to toggle)
eagle-usb 2.1.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,108 kB
  • ctags: 2,612
  • sloc: ansic: 27,560; sh: 5,440; perl: 3,269; xml: 1,079; tcl: 915; makefile: 878
file content (100 lines) | stat: -rwxr-xr-x 3,201 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/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
exit 123

# 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 ***
#
#***************************************************************************/