summaryrefslogtreecommitdiffstats
path: root/projects/scII-bmwm/etc/init.d/ppp-update
blob: ea2ac48e2c4307f84d43940fc4c5815e750b23ac (plain)
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
#!/bin/sh
#
# /etc/init.d/ppp-update
#
# Configuration for BMW
#
# 2004/02/27 Robert Schwebel <r.schwebel@pengutronix.de>
#

user=$2
pass=$3
pin=$4

case $1 in 

	start)
		logger -s "updating ppp configuration"
		sed -e "s/@USER@/$user/g" -e "s/@PASS@/$pass/g" \
			/etc/ppp/pap-secrets.in > 		\
			/etc/ppp/pap-secrets
		chmod 600 /etc/ppp/pap-secrets
		sed -e "s/@PIN@/$pin/g" \
			/etc/ppp/peers/gprs-connect-chat.in > 	\
			/etc/ppp/peers/gprs-connect-chat
		chmod 775 /etc/ppp/peers/gprs-connect-chat
		sed -e "s/@USER@/$user/g" \
			/etc/ppp/peers/gprs.in > 		\
			/etc/ppp/peers/gprs
		;;

	stop)
		logger -s "removing ppp configuration"
		rm -f /etc/ppp/pap-secrets
		rm -f /etc/ppp/peers/gprs-connect-chat
		rm -f /etc/ppp/peers/gprs
		;;

	*)
		echo "usage: $0 [stop][start user pass pin]"
		;;
esac