Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1501 → Rev 1502

/scripts/alcasar-sms.sh
1,6 → 1,14
#!/bin/bash
 
# alcasar-sms.sh
# by Nicolas Aubry & Rexy
# This script is distributed under the Gnu General Public License (GPL)
 
# This script manages the 'gammu-smsd' service when a GSM adapter is detected
# Ce script gère le service 'gammu-smsd' quand un adaptateur GSM est détecté
 
#########################################
####### VARIABLES ne pas toucher ########
####### VARIABLES ########
nb_essais=3
time_account=1
time_ban=2
327,15 → 335,27
exit 0
;;
--start)
start_gammu
sed -i "s/\$service_SMS_status=false;/\$service_SMS_status=true;/g" $index_page
sed -i "s/\$service_SMS_status=false;/\$service_SMS_status=true;/g" $public_page
gammu_pid=`/usr/sbin/pidof gammu-smsd|wc -l`
if [ $gammu_pid != "0" ]
then
echo "gammu is already started"
else
start_gammu
sed -i "s/\$service_SMS_status=false;/\$service_SMS_status=true;/g" $index_page
sed -i "s/\$service_SMS_status=false;/\$service_SMS_status=true;/g" $public_page
fi
exit 0
;;
--stop)
stop_gammu
sed -i "s/\$service_SMS_status=true;/\$service_SMS_status=false;/g" $index_page
sed -i "s/\$service_SMS_status=true;/\$service_SMS_status=false;/g" $public_page
gammu_pid=`/usr/sbin/pidof gammu-smsd|wc -l`
if [ $gammu_pid != "0" ]
then
stop_gammu
sed -i "s/\$service_SMS_status=true;/\$service_SMS_status=false;/g" $index_page
sed -i "s/\$service_SMS_status=true;/\$service_SMS_status=false;/g" $public_page
else
echo "gammu is already stopped"
fi
exit 0
;;
--pidof)