Cleanup, README

This commit is contained in:
2017-11-13 12:08:23 +01:00
parent 410972b8ce
commit 092a79e484
13 changed files with 153 additions and 592 deletions
+13 -13
View File
@@ -1,18 +1,18 @@
#!/bin/bash
echo "$(date): Connect to Internet..."
#systemctl stop gammu-smsd
pon rnet
sleep 20
sleep 5
x=0
# Wait until connection is established
if ping -c 1 8.8.8.8 &>/dev/null ; then
echo "Already Connected - $(date)"
else
echo "Not Connected - $( date )"
echo "connecting wait ..."
sleep 20
fi
# Wir wollen sicher sein, dass die Verbindung steht...
ping -c 1 -w 30 8.8.8.8 >/dev/null
sleep 3
while ! ping -c 1 8.8.8.8 &>/dev/null ; do
echo "$(date): wait for internet connection to come up"
sleep 5
if [ $x -gt 10 ]; then
# Time out here
echo "$(date): Could not connect to internet (timeout)..."
exit 1
fi
x=$((x+1))
done
echo "$(date): Connected to Internet..."
+1 -2
View File
@@ -1,6 +1,5 @@
#!/bin/bash
echo "$(date): Disconnect from Internet..."
poff rnet
sleep 10
#systemctl start gammu-smsd
sleep 5
pkill pppd
+2 -3
View File
@@ -18,7 +18,6 @@ APP_ROOT = "/home/beieli"
with open("%s/bin/beielimon-config.yaml" % (APP_ROOT), 'r') as stream:
try:
config_data = yaml.load(stream)
#print(config_data)
except yaml.YAMLError as exc:
print(exc)
@@ -98,6 +97,8 @@ def GetInfoText():
commands_output = ""
for comm_arr in [ ['uptime','--pretty'],
['date'],
['uname', '-a'],
['df','-h','/boot','/root'],
['free','-m'],
['ip','a'] ]:
@@ -200,8 +201,6 @@ def download(infotime):
os.makedirs(myzipdir)
my_pattern = '%s%s' % (infotime,'?' * (8 - len(infotime)))
files = glob.glob("%s/data/weight-*-%s.log" % (APP_ROOT,my_pattern))
for f in files:
print("%s" % (f))
for s in config_data['scales']:
filename = "%s/%s-%s.csv" % (mycsvdir,s['alias'].replace(' ','_'),infotime)
with open(filename, 'a') as file:
-7
View File
@@ -1,7 +0,0 @@
#!/bin/sh
PROGRAM=/home/beieli/bin/process_sms_request.py
echo "Received $SMS_MESSAGES physical messages and $DECODED_PARTS of decoded message parts" >> /tmp/process_sms_request.log 2>&1
for i in `seq $SMS_MESSAGES` ; do
eval "/usr/bin/sudo -u beieli $PROGRAM \"\${SMS_${i}_NUMBER}\" \"\${SMS_${i}_TEXT}\" >> /tmp/process_sms_request.log 2>&1"
done
exit 0