edit: ajout du spaceapi
This commit is contained in:
@@ -8,16 +8,16 @@ if [ "$#" = "0" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#SPACE_JSON=/var/www/html/spaceapi/space.json
|
||||
SPACE_JSON=/var/www/html/spaceapi/space.json
|
||||
|
||||
if [ "$1" = "opened" ]; then
|
||||
ln -sf "index.ouvert.html" "$(dirname $0)/index.html"
|
||||
#jq "setpath([\"state\", \"open\"]; true) | setpath([\"state\", \"lastchange\"]; $(date +%s))" < $SPACE_JSON > $SPACE_JSON.new &&
|
||||
#mv -f $SPACE_JSON.new $SPACE_JSON
|
||||
jq "setpath([\"state\", \"open\"]; true) | setpath([\"state\", \"lastchange\"]; $(date +%s))" < $SPACE_JSON > $SPACE_JSON.new &&
|
||||
mv -f $SPACE_JSON.new $SPACE_JSON
|
||||
fi
|
||||
|
||||
if [ "$1" = "closed" ]; then
|
||||
ln -sf "index.fermé.html" "$(dirname $0)/index.html"
|
||||
#jq "setpath([\"state\", \"open\"]; false) | setpath([\"state\", \"lastchange\"]; $(date +%s))" < $SPACE_JSON > $SPACE_JSON.new &&
|
||||
#mv -f $SPACE_JSON.new $SPACE_JSON
|
||||
jq "setpath([\"state\", \"open\"]; false) | setpath([\"state\", \"lastchange\"]; $(date +%s))" < $SPACE_JSON > $SPACE_JSON.new &&
|
||||
mv -f $SPACE_JSON.new $SPACE_JSON
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user