refactoring changes from sequpgrade (endReturn, ...) and some modernizations

This commit is contained in:
2023-01-03 15:49:08 +01:00
parent 215135e8aa
commit 3c22d5729f
69 changed files with 553 additions and 654 deletions

View File

@@ -34,21 +34,21 @@ step_1() {
#exe apt update
exe apt install $toolDeps $toolDeps2 "$aptOpt"
#exe apt install "$toolDeps2" "$aptOpt"
endReturn -o $? "Installation of prerequisits failed"
endReturn "Installation of prerequisits failed"
}
step_2_info() { echo "Install jabber prerequisits"; echoinfo "(May be skipped)"; }
step_2() {
exe apt install $toolDepsJabber "$aptOpt"
endReturn -o $? "Installation of prerequisits for jabber failed"
endReturn "Installation of prerequisits for jabber failed"
}
step_3_info() { echo "Download and install $toolName version $toolVersion"; }
step_3() {
exe wget "$toolUrl" -O "$downPath"
endReturn -o $? "Download of $toolName failed"
endReturn "Download of $toolName failed"
exe dpkg -i "$downPath"
endReturn -o $? "Installation of $toolName failed"
endReturn "Installation of $toolName failed"
info "$toolName is now running on http://$(hostname -I | cut -d " " -f 1):8083"
}
downPath="/tmp/$toolDpkg"
@@ -56,14 +56,14 @@ downPath="/tmp/$toolDpkg"
step_20_info() { echo "List $toolName prerequisits"; }
step_20_alias() { echo "listdeps"; }
step_20() {
echo " [I] $toolName prerequisits:"
info "$toolName prerequisits:"
echo "$toolDeps $toolDeps2"
}
step_30_info() { echo "Create user $toolUser"; }
step_30() {
exe useradd --system --home "$toolHome" --gid dialout --shell /bin/false "$toolUser"
endReturn -o $? "Creating user $toolUser failed"
endReturn "Creating user $toolUser failed"
}
step_32_info() { echo "Create $toolName systemd service"; }
@@ -78,11 +78,11 @@ step_34_alias() { echo "downgrade_xmpp"; }
step_34() {
if [ ! -f $libnetDown ]; then
exe wget "$libnetUrl" -O "$libnetDown"
endReturn -o $? "Download of $libnetUrl failed"
endReturn "Download of $libnetUrl failed"
fi
if [ ! -f $libxmlDown ]; then
exe wget "$libxmlUrl" -O "$libxmlDown"
endReturn -o $? "Download of $libxmlUrl failed"
endReturn "Download of $libxmlUrl failed"
fi
local aptOption=
@@ -104,7 +104,7 @@ step_34() {
saveReturn $?
exe dpkg -i "$libnetDown"
saveReturn $?
exe apt install libnet-jabber-perl $aptOption
exe apt install libnet-jabber-perl $aptOption
saveReturn $?
endReturn "Failed removing packages; Manual fix required"
@@ -124,7 +124,7 @@ step_35() {
aptPinFile="/etc/apt/preferences.d/00_FhemJabber"
aptPinXmpp="Package: libnet-xmpp-perl
Pin: version 1.02-3*
Pin-Priority: 1000
Pin-Priority: 1000
Package: libxml-stream-perl
Pin: version 1.23-2