better initializing of status after reinstall
parent
61a55181f0
commit
7988b40afb
|
@ -32,12 +32,17 @@ then
|
||||||
else
|
else
|
||||||
logger -t $(basename $0) "$$ never run before (new install?) setting spacestatus to closed"
|
logger -t $(basename $0) "$$ never run before (new install?) setting spacestatus to closed"
|
||||||
echo "closed" > /run/spacestatus
|
echo "closed" > /run/spacestatus
|
||||||
|
echo "closed" > /root/var/spacestatus
|
||||||
fi
|
fi
|
||||||
chown www-data /run/spacestatus
|
chown www-data /run/spacestatus
|
||||||
fi
|
fi
|
||||||
|
|
||||||
status="$(cat /run/spacestatus)"
|
status="$(cat /run/spacestatus)"
|
||||||
oldstatus="$(cat /root/var/spacestatus)"
|
oldstatus="$(cat /root/var/spacestatus)"
|
||||||
|
if [ "$oldstatus" = "" ]
|
||||||
|
then
|
||||||
|
oldstatus="$status"
|
||||||
|
fi
|
||||||
doorlockbutton="$(cat /run/doorlockbutton)"
|
doorlockbutton="$(cat /run/doorlockbutton)"
|
||||||
nai=$(stat -c "%Y" /run/spacestatus) # get mtime as status change time
|
nai=$(stat -c "%Y" /run/spacestatus) # get mtime as status change time
|
||||||
if [ "$status" = "open" ]
|
if [ "$status" = "open" ]
|
||||||
|
|
Loading…
Reference in New Issue