Subversion Repositories ALCASAR

Rev

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

Rev 2454 Rev 2553
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-sms.sh 2454 2017-12-09 18:59:31Z tom.houdayer $
2
# $Id: alcasar-sms.sh 2553 2018-05-09 22:04:53Z 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="password"
19
p_db="rectAE3BAWRJqQo7"
20
#########################################
20
#########################################
21
#########################################
21
#########################################
22
 
22
 
23
rad="radcheck"
23
rad="radcheck"
24
radgp="radusergroup"
24
radgp="radusergroup"
Line 30... Line 30...
30
 
30
 
31
inb="inbox"
31
inb="inbox"
32
SMS_c="SMS_country"
32
SMS_c="SMS_country"
33
 
33
 
34
config="/etc/gammu_smsd_conf"
34
config="/etc/gammu_smsd_conf"
-
 
35
config2="/etc/gammurc"
35
logfile="/var/log/gammu-smsd/gammu-smsd.log"
36
logfile="/var/log/gammu-smsd/gammu-smsd.log"
36
script="/usr/local/bin/alcasar-sms.sh"
37
script="/usr/local/bin/alcasar-sms.sh"
37
public_page="/var/www/html/autoregistrationinfo.php"
38
public_page="/var/www/html/autoregistrationinfo.php"
38
index_page="/var/www/html/index.php"
39
index_page="/var/www/html/index.php"
39
intercept_page="/var/www/html/intercept.php"
40
intercept_page="/var/www/html/intercept.php"
Line 402... Line 403...
402
	#--log)
403
	#--log)
403
	#	# Récupère le nom du fichier de log
404
	#	# Récupère le nom du fichier de log
404
	#	cat $config | grep logfile | cut -d ' ' -f3
405
	#	cat $config | grep logfile | cut -d ' ' -f3
405
	#	exit 0
406
	#	exit 0
406
	#	;;
407
	#	;;
407
	--connect)
408
	--speed)
408
		# Récupère la vitesse de co
409
		# Get connection speed
409
		cat $config | grep connection | cut -d ' ' -f3
410
		cat $config | grep ^connection | cut -d ' ' -f3
410
		exit 0
411
		exit 0
411
		;;
412
		;;
412
	--replace_connect)
413
	--replace_speed)
413
		# Edition de la vitesse de co
414
		# write the connection speed
414
		sed -i "s/^connection = at.*/connection = at$2/g" $config
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
-
 
418
		;;
-
 
419
	--port)
-
 
420
		# Get connection speed
-
 
421
		cat $config | grep ^port | cut -d ' ' -f3
-
 
422
		exit 0
-
 
423
		;;
-
 
424
	--replace_port)
-
 
425
		# write the connection speed
-
 
426
		sed -i "s?^port =.*?port = $2?g" $config
-
 
427
		sed -i "s?^device = .*?device = $2?g" $config2
415
		exit 0
428
		exit 0
416
		;;
429
		;;
417
	--pin)
430
	--pin)
418
		# Récupère le code PIN (file de conf)
431
		# Récupère le code PIN (file de conf)
419
		cat $config | grep PIN | cut -d ' ' -f3
432
		cat $config | grep ^PIN | cut -d ' ' -f3
420
		exit 0
433
		exit 0
421
		;;
434
		;;
422
	--replace_pin)
435
	--replace_pin)
423
		# Edition du code PIN
436
		# Edition du code PIN
424
		sed -i "s/^PIN =.*/PIN = $2/g" $config
437
		sed -i "s/^PIN =.*/PIN = $2/g" $config