From 7b913ab8eee4632cdafe5d15e022d77a78aa529a Mon Sep 17 00:00:00 2001 From: Marcell Mars Date: Wed, 2 Dec 2020 23:43:28 +0100 Subject: [PATCH] self-destructing install script for gitea --- install_sphook.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 install_sphook.sh diff --git a/install_sphook.sh b/install_sphook.sh new file mode 100644 index 00000000..376c8e9e --- /dev/null +++ b/install_sphook.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# this script should be pasted as post-receive hook in gitea +# and if sphook is not there yet it will download it +# if sphook is already there the script deletes itself + +set -e + +cd hooks/post-receive.d/ + +if [ -f "sphook" ]; then + echo "sphook exists. install_sphook.sh will delete itself..." + rm post-receive + echo "install_sphook.sh no more." +else + echo "sphook doesn't exist. let's download it." + wget https://git.sandpoints.org/Drawwell/SandpointsGitHook/raw/branch/master/sphook + chmod +x sphook + echo "sphook downloaded. let's pump some water out of a sandpoint..." +fi \ No newline at end of file