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

@@ -39,7 +39,7 @@ seq_config() {
SEQ_OSNAME="Ubuntu"
fi
echo " [I] Detected OS: $SEQ_OSNAME $SEQ_DISTNAME"
info "Detected OS: $SEQ_OSNAME $SEQ_DISTNAME"
}
step_1_info() { echo "Install $toolName dependencies"; }
@@ -54,7 +54,7 @@ step_1() {
fi
exe apt update
endReturn -o $? "Updating apt repositories failed"
endReturn "Updating apt repositories failed"
if quiet ; then
aptOption="-y"
@@ -75,24 +75,24 @@ step_2() {
fi
if [ "$motionUrl" == "" ]; then
echo " [W] Unsupported OS"
warning "Unsupported OS"
return 1
fi
exe wget -O "$motionDownload" $motionUrl
endReturn -o $? "Download motion failed"
endReturn "Download motion failed"
}
motionDownload="/tmp/motion.deb"
step_3_info() { echo "Install downloaded motion version"; }
step_3() {
if [ ! -f "$motionDownload" ]; then
echo " [I] No downloaded motion found attempting download"
info "No downloaded motion found attempting download"
step 2
fi
exe dpkg -i "$motionDownload"
endReturn -o $? "Installing motion failed"
endReturn "Installing motion failed"
}
step_4_info() { echo "Upgrade python pip"; }
@@ -100,13 +100,13 @@ step_4_alias() { echo "upgradepip"; }
step_4()
{
exe pip install --upgrade pip
endReturn -o $? "Upgrading pip failed"
endReturn "Upgrading pip failed"
}
step_5_info() { echo "Install $toolName"; }
step_5() {
exe pip install motioneye
endReturn -o $? "Installing $toolName failed"
endReturn "Installing $toolName failed"
}
step_6_info() { echo "Prepare configuration directory $toolCfgDir"; }
@@ -129,7 +129,7 @@ motioneyeMediaDir="/var/lib/motioneye"
step_8_info() { echo "Create $toolName service"; }
step_8() {
exe cp "$motioneyeServiceSource" "$motioneyeServiceTarget"
endReturn -o $? "Creating service failed"
endReturn "Creating service failed"
exe systemctl daemon-reload
exe systemctl enable motioneye
exe systemctl start motioneye
@@ -142,7 +142,7 @@ step_20_alias() { echo "upgrade"; }
step_20() {
step "upgradepip"
exe pip install motioneye --upgrade
endReturn -o $? "Upgrading $toolName failed"
endReturn "Upgrading $toolName failed"
exe systemctl restart motioneye
}