Subversion Repositories ALCASAR

Rev

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

Rev 1452 Rev 1502
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
-
 
2
 
-
 
3
# alcasar-sms.sh
-
 
4
# by Nicolas Aubry & Rexy
-
 
5
# This script is distributed under the Gnu General Public License (GPL)
-
 
6
 
-
 
7
# This script manages the 'gammu-smsd' service when a GSM adapter is detected
-
 
8
# Ce script gère le service 'gammu-smsd' quand un adaptateur GSM est détecté
-
 
9
 
2
#########################################
10
#########################################
3
#######	VARIABLES ne pas toucher ########
11
#######	VARIABLES ########
4
nb_essais=3
12
nb_essais=3
5
time_account=1
13
time_account=1
6
time_ban=2
14
time_ban=2
7
#########################################
15
#########################################
8
####### IDs DB ##########################
16
####### IDs DB ##########################
Line 325... Line 333...
325
	-h | --help)
333
	-h | --help)
326
		echo "$usage"
334
		echo "$usage"
327
		exit 0
335
		exit 0
328
		;;
336
		;;
329
	--start)
337
	--start)
-
 
338
		gammu_pid=`/usr/sbin/pidof gammu-smsd|wc -l`
-
 
339
		if [ $gammu_pid != "0" ]
-
 
340
			then
-
 
341
			echo "gammu is already started"
-
 
342
		else
330
		start_gammu
343
			start_gammu
331
		sed -i "s/\$service_SMS_status=false;/\$service_SMS_status=true;/g" $index_page
344
			sed -i "s/\$service_SMS_status=false;/\$service_SMS_status=true;/g" $index_page
332
		sed -i "s/\$service_SMS_status=false;/\$service_SMS_status=true;/g" $public_page
345
			sed -i "s/\$service_SMS_status=false;/\$service_SMS_status=true;/g" $public_page
-
 
346
		fi
333
		exit 0
347
		exit 0
334
		;;
348
		;;
335
	--stop)
349
	--stop)
-
 
350
		gammu_pid=`/usr/sbin/pidof gammu-smsd|wc -l`
-
 
351
		if [ $gammu_pid != "0" ]
-
 
352
			then
336
		stop_gammu
353
			stop_gammu
337
		sed -i "s/\$service_SMS_status=true;/\$service_SMS_status=false;/g" $index_page
354
			sed -i "s/\$service_SMS_status=true;/\$service_SMS_status=false;/g" $index_page
338
		sed -i "s/\$service_SMS_status=true;/\$service_SMS_status=false;/g" $public_page
355
			sed -i "s/\$service_SMS_status=true;/\$service_SMS_status=false;/g" $public_page
-
 
356
		else
-
 
357
			echo "gammu is already stopped"
-
 
358
		fi
339
		exit 0 
359
		exit 0 
340
		;;
360
		;;
341
	--pidof)
361
	--pidof)
342
		/sbin/pidof gammu-smsd
362
		/sbin/pidof gammu-smsd
343
		;;
363
		;;