Subversion Repositories ALCASAR

Rev

Rev 2553 | Rev 2558 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2553 Rev 2557
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-sms.sh 2553 2018-05-09 22:04:53Z rexy $
2
# $Id: alcasar-sms.sh 2557 2018-06-03 21:06:17Z rexy $
3
 
3
 
4
# alcasar-sms.sh
4
# alcasar-sms.sh
5
# by Nicolas Aubry & Rexy
5
# by Nicolas Aubry & Rexy
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 14... Line 14...
14
time_account=1
14
time_account=1
15
time_ban=2
15
time_ban=2
16
#########################################
16
#########################################
17
####### IDs DB ##########################
17
####### IDs DB ##########################
18
u_db="radius"
18
u_db="radius"
19
p_db="rectAE3BAWRJqQo7"
19
p_db="password"
20
#########################################
20
#########################################
21
#########################################
21
#########################################
22
 
22
 
23
rad="radcheck"
23
rad="radcheck"
24
radgp="radusergroup"
24
radgp="radusergroup"
Line 403... Line 403...
403
	#--log)
403
	#--log)
404
	#	# Récupère le nom du fichier de log
404
	#	# Récupère le nom du fichier de log
405
	#	cat $config | grep logfile | cut -d ' ' -f3
405
	#	cat $config | grep logfile | cut -d ' ' -f3
406
	#	exit 0
406
	#	exit 0
407
	#	;;
407
	#	;;
408
	--speed)
408
	--connect)
409
		# Get connection speed
409
		# display the com port speed
410
		cat $config | grep ^connection | cut -d ' ' -f3
410
		cat $config | grep connection | cut -d ' ' -f3
411
		exit 0
411
		exit 0
412
		;;
412
		;;
413
	--replace_speed)
413
	--replace_port)
414
		# write the connection speed
414
		# modify the com port
415
		sed -i "s/^connection = at.*/connection = at$2/g" $config
-
 
416
		sed -i "s/^connection = at.*/connection = at$2/g" $config2
-
 
417
		exit 0
415
		echo $2
418
		;;
-
 
419
	--port)
-
 
420
		# Get connection speed
416
		sed -i "s?^port = .*?port = $2?g" $config
421
		cat $config | grep ^port | cut -d ' ' -f3
417
		sed -i "0,/^device =/ s?device =.*?device = $2?" $config2
422
		exit 0
418
		exit 0
423
		;;
419
		;;
424
	--replace_port)
420
	--replace_speed)
425
		# write the connection speed
421
		# modufy the com port speed
426
		sed -i "s?^port =.*?port = $2?g" $config
422
		sed -i "s/^connection = at.*/connection = at$2/g" $config
427
		sed -i "s?^device = .*?device = $2?g" $config2
423
		sed -i "0,/^connection =/ s/connection =.*/connection = $2/" $config2
428
		exit 0
424
		exit 0
429
		;;
425
		;;
430
	--pin)
426
	--pin)
431
		# Récupère le code PIN (file de conf)
427
		# Récupère le code PIN (file de conf)
432
		cat $config | grep ^PIN | cut -d ' ' -f3
428
		cat $config | grep PIN | cut -d ' ' -f3
433
		exit 0
429
		exit 0
434
		;;
430
		;;
435
	--replace_pin)
431
	--replace_pin)
436
		# Edition du code PIN
432
		# Edition du code PIN
437
		sed -i "s/^PIN =.*/PIN = $2/g" $config
433
		sed -i "s/^PIN =.*/PIN = $2/g" $config