bunch of new stuff, a few fixes
[distro-setup] / eggdrop-upgrade
1 #!/bin/bash
2
3 if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi
4 shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4
5 set -eE -o pipefail
6 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
7
8
9 if [[ ! -d ~/eggdrop-src ]]; then
10 exit 0
11 fi
12 cd ~/eggdrop-src
13 git fetch -q
14
15 newest_tag=$(git tag | grep ^v|sort -Vr|head -n1)
16
17 this_tag=$(git describe --tags)
18
19 if [[ $newest_tag == "$this_tag" ]]; then
20 exit 0
21 fi
22
23 set -x
24
25 git checkout -q $newest_tag
26 make clean
27 ./configure
28 make config
29 make
30 make install
31 systemctl --user stop fsysbot
32 sleep 10
33 systemctl --user start fsysbot