Subversion Repositories ALCASAR

Compare Revisions

No changes between revisions

Ignore whitespace Rev 2249 → Rev 2250

/scripts/alcasar-sms.sh
1,4 → 1,5
#!/bin/bash
# $Id$
 
# alcasar-sms.sh
# by Nicolas Aubry & Rexy
341,9 → 342,9
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
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
;;
352,9 → 353,9
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
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
Property changes:
Added: svn:keywords
+Id
\ No newline at end of property
/scripts/alcasar-watchdog.sh
17,13 → 17,13
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
private_ip_mask=`grep PRIVATE_IP= $CONF_FILE|cut -d"=" -f2`
private_ip_mask=${private_ip_mask:=192.168.182.1/24}
PRIVATE_IP=`echo "$private_ip_mask" |cut -d"/" -f1` # @ip du portail (côté LAN)
PRIVATE_IP=`echo "$private_ip_mask" |cut -d"/" -f1` # @ip du portail (côté LAN)
PRIVATE_IP=${PRIVATE_IP:=192.168.182.1}
current_users_file="/var/tmp/havp/current_users.txt" # file containing active users with their "status.php" tab open
current_users_file="/var/tmp/havp/current_users.txt" # file containing active users with their "status.php" tab open
DIR_WEB="/var/www/html"
Index_Page="$DIR_WEB/index.php"
IPTABLES="/sbin/iptables"
TUNIF="tun0" # listen device for chilli daemon
TUNIF="tun0" # listen device for chilli daemon
OLDIFS=$IFS
IFS=$'\n'
 
42,10 → 42,10
/bin/sed -i "s?diagnostic =.*?diagnostic = \"can't contact the default router\";?g" $Index_Page
;;
esac
net_pb=`grep "network_pb = True;" $Index_Page|wc -l`
net_pb=`grep "network_pb = true;" $Index_Page|wc -l`
if [ $net_pb = "0" ] # user alert (only the first time)
then
/bin/sed -i "s?^\$network_pb.*?\$network_pb = True;?g" $Index_Page
/bin/sed -i "s?^\$network_pb.*?\$network_pb = true;?g" $Index_Page
$IPTABLES -I PREROUTING -t nat -i $TUNIF -p udp --dport domain -j REDIRECT --to-port 56
fi
}
82,10 → 82,10
# else switch in normal mode
else
echo "Internet access is OK for now"
net_pb=`grep "network_pb = True;" $Index_Page|wc -l`
net_pb=`grep "network_pb = true;" $Index_Page|wc -l`
if [ $net_pb != "0" ]
then
/bin/sed -i "s?^\$network_pb.*?\$network_pb = False;?g" $Index_Page
/bin/sed -i "s?^\$network_pb.*?\$network_pb = false;?g" $Index_Page
$IPTABLES -D PREROUTING -t nat -i $TUNIF -p udp --dport domain -j REDIRECT --to-port 56
fi
fi