bunch of new stuff, a few fixes
[distro-setup] / eggdrop-upgrade
diff --git a/eggdrop-upgrade b/eggdrop-upgrade
new file mode 100755 (executable)
index 0000000..31e81d4
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi
+shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4
+set -eE -o pipefail
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
+
+
+if [[ ! -d ~/eggdrop-src ]]; then
+  exit 0
+fi
+cd ~/eggdrop-src
+git fetch -q
+
+newest_tag=$(git tag | grep ^v|sort -Vr|head -n1)
+
+this_tag=$(git describe --tags)
+
+if [[ $newest_tag == "$this_tag" ]]; then
+  exit 0
+fi
+
+set -x
+
+git checkout -q $newest_tag
+make clean
+./configure
+make config
+make
+make install
+systemctl --user stop fsysbot
+sleep 10
+systemctl --user start fsysbot