changed repo path
This commit is contained in:
parent
deed2c6764
commit
98f31f6965
37
foodoor-trigger
Executable file
37
foodoor-trigger
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PIPE_PATH=/var/run/foodoord.pipe
|
||||||
|
|
||||||
|
if [ ! -e $PIPE_PATH ]
|
||||||
|
then
|
||||||
|
echo "Pipe missing. Check daemon status."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
action="$1"
|
||||||
|
isTriggerActivated="0"
|
||||||
|
|
||||||
|
if [ -z "$action" ]
|
||||||
|
then
|
||||||
|
action="$SSH_ORIGINAL_COMMAND"
|
||||||
|
isTriggerActivated="1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $action in
|
||||||
|
close|open)
|
||||||
|
echo $action | tee $PIPE_PATH > /tmp/state
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $(basename $0) { close, open, status }"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ $isTriggerActivated -eq 1 ]
|
||||||
|
then
|
||||||
|
cat /tmp/state
|
||||||
|
sleep 2
|
||||||
|
fi
|
@ -10,7 +10,7 @@ temp_outfile="$dest.tmp"
|
|||||||
if [ ! -e "${dest}/.git/config" ]
|
if [ ! -e "${dest}/.git/config" ]
|
||||||
then
|
then
|
||||||
#echo "Repo does not exist, trying to clone..."
|
#echo "Repo does not exist, trying to clone..."
|
||||||
( cd /var/run && git clone --quiet --single-branch --depth=1 ssh://git.chaospott.de/Chaospott/foodoor-keys.git "${dest}" )
|
( cd /var/run && git clone --quiet --single-branch --depth=1 ssh://git.chaospott.de/Keyverwaltung/foodoor-keys.git "${dest}" )
|
||||||
else
|
else
|
||||||
#echo "Repo exists, updating..."
|
#echo "Repo exists, updating..."
|
||||||
( cd "${dest}" && git fetch --quiet && git merge --quiet origin/master master )
|
( cd "${dest}" && git fetch --quiet && git merge --quiet origin/master master )
|
||||||
|
Loading…
Reference in New Issue
Block a user