35,6 → 35,7 |
script="/usr/local/bin/alcasar-sms.sh" |
public_page="/var/www/html/autoregistrationinfo.php" |
index_page="/var/www/html/index.php" |
intercept_page="/var/www/html/intercept.php" |
separator="########## START ##########" |
end="%%%%%%%%%% STOP %%%%%%%%%%" |
|
251,8 → 252,7 |
d_exp=$(date --date "$date_expiration" +%s) |
d_scr=$(date --date "$date_script" +%s) |
|
|
if test $d_scr -gt $d_exp # Si le ban à expiré |
if test $d_scr -ge $d_exp # Si le ban à expiré |
then |
|
# Test sur le nombre de mots (resultat) |
336,28 → 336,30 |
;; |
--start) |
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) |
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 |
;; |
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 |
sed -i "s/\$service_SMS_status=false;/\$service_SMS_status=true;/g" $intercept_page |
fi |
exit 0 |
;; |
--stop) |
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 |
sed -i "s/\$service_SMS_status=true;/\$service_SMS_status=false;/g" $intercept_page |
else |
echo "gammu is already stopped" |
fi |
exit 0 |
;; |
--pidof) |
/sbin/pidof gammu-smsd |
;; |