add listmonk update script
This commit is contained in:
parent
790727896b
commit
a32b1ec412
27
updates/listmonk.sh
Normal file
27
updates/listmonk.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
export XDG_RUNTIME_DIR=/run/user/$UID
|
||||
|
||||
release=`curl -L https://api.github.com/repos/knadh/listmonk/releases/latest -s | jq -r '.tag_name'`
|
||||
# listmonks file identifier is lacking the 'v'
|
||||
release=${release//v}
|
||||
installdir=$HOME/bin
|
||||
|
||||
echo ">>> Listmonk is currently running: $($installdir/listmonk --version)"
|
||||
echo "======== Latest release is [ $release ] ========"
|
||||
read -p "=> Reply yY to proceed..." -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
|
||||
fi
|
||||
|
||||
systemctl stop --user listmonk
|
||||
|
||||
curl -sL https://github.com/knadh/listmonk/releases/download/v$release/listmonk_${release}_linux_amd64.tar.gz | tar xvz -C $installdir/
|
||||
$installdir/listmonk --upgrade
|
||||
|
||||
systemctl start --user listmonk
|
||||
|
||||
sleep 2
|
||||
systemctl status --no-pager --user listmonk
|
Loading…
Reference in New Issue
Block a user