better initializing of status after reinstall

master
pidor 2017-03-13 23:02:56 +00:00
parent 61a55181f0
commit 7988b40afb
1 changed files with 5 additions and 0 deletions

View File

@ -32,12 +32,17 @@ then
else
logger -t $(basename $0) "$$ never run before (new install?) setting spacestatus to closed"
echo "closed" > /run/spacestatus
echo "closed" > /root/var/spacestatus
fi
chown www-data /run/spacestatus
fi
status="$(cat /run/spacestatus)"
oldstatus="$(cat /root/var/spacestatus)"
if [ "$oldstatus" = "" ]
then
oldstatus="$status"
fi
doorlockbutton="$(cat /run/doorlockbutton)"
nai=$(stat -c "%Y" /run/spacestatus) # get mtime as status change time
if [ "$status" = "open" ]