Subversion Repositories ALCASAR

Rev

Rev 2875 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2875 Rev 3093
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-sms.sh 2875 2020-11-01 10:50:57Z rexy $
2
# $Id: alcasar-sms.sh 3093 2022-12-11 23:07:02Z 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 286... Line 286...
286
		if [ $failed == "1" ]
286
		if [ $failed == "1" ]
287
		then
287
		then
288
			sed -i "s/^SMS=.*/SMS=off/" $CONF_FILE
288
			sed -i "s/^SMS=.*/SMS=off/" $CONF_FILE
289
			exit 0
289
			exit 0
290
		fi
290
		fi
291
		gammu_pid=`/usr/sbin/pidof gammu-smsd|wc -l`
291
		gammu_pid=`/usr/bin/pidof gammu-smsd|wc -l`
292
		if [ $gammu_pid != "0" ]
292
		if [ $gammu_pid != "0" ]
293
		then
293
		then
294
			echo "Gammu is already started"
294
			echo "Gammu is already started"
295
		else
295
		else
296
			start_gammu
296
			start_gammu
Line 304... Line 304...
304
			fi
304
			fi
305
		fi
305
		fi
306
		exit 0
306
		exit 0
307
		;;
307
		;;
308
	--stop)
308
	--stop)
309
		gammu_pid=`/usr/sbin/pidof gammu-smsd|wc -l`
309
		gammu_pid=`/usr/bin/pidof gammu-smsd|wc -l`
310
		if [ $gammu_pid != "0" ]
310
		if [ $gammu_pid != "0" ]
311
		then
311
		then
312
			stop_gammu
312
			stop_gammu
313
		else
313
		else
314
			echo "Gammu is already stopped"
314
			echo "Gammu is already stopped"
315
		fi
315
		fi
316
		sed -i "s/^SMS=.*/SMS=off/" $CONF_FILE
316
		sed -i "s/^SMS=.*/SMS=off/" $CONF_FILE
317
		exit 0
317
		exit 0
318
		;;
318
		;;
319
	--pidof)
319
	--pidof)
320
		/sbin/pidof gammu-smsd
320
		/usr/bin/pidof gammu-smsd
321
		;;
321
		;;
322
	--last_nosim)
322
	--last_nosim)
323
		# Récupère la dernière ligne où NOSIM est présent (error)
323
		# Récupère la dernière ligne où NOSIM est présent (error)
324
		cat $logfile | grep -n "NOSIM" | cut -d ':' -f1 | tail -n 1
324
		cat $logfile | grep -n "NOSIM" | cut -d ':' -f1 | tail -n 1
325
		exit 0
325
		exit 0