Used sequpgrade.sh to upgrade existing seqs

This commit is contained in:
2022-05-29 20:58:23 +02:00
parent 10ee4198f0
commit 6214493c18
57 changed files with 802 additions and 806 deletions

View File

@@ -36,9 +36,9 @@ toolServiceLoc="/etc/systemd/system/${toolName}.service"
readonly goDir="/usr/local/go"
readonly goDownLoc="/tmp/go.tar.gz"
step_config() {
seq_config() {
if [ -z $toolVersion ] ; then
echoerr " [E] Couldn't determine latest version of $toolName"
error -e "Couldn't determine latest version of $toolName"
fi
}
@@ -46,7 +46,7 @@ step_1_info() {
echo "Downloading $toolName version ${toolVersion} to ${toolLoc} from:"
echoinfo "$toolDownload"
}
step_1_alias() { ALIAS="install"; }
step_1_alias() { echo "install"; }
step_1() {
step upgrade
endReturn -o $? "Download failed"
@@ -74,9 +74,9 @@ step_4() {
}
step_5_info() { echo "Show configuration notes"; }
step_5_alias() { ALIAS="notes"; }
step_5_alias() { echo "notes"; }
step_5() {
outColor green
color green
cat <<NOTES_END
# Sample configuration
@@ -87,7 +87,7 @@ NOTES_END
}
step_10_info() { echo "Backup existing executable"; }
step_10_alias() { ALIAS="backup"; }
step_10_alias() { echo "backup"; }
step_10() {
if [ -f "$toolLoc" ] ; then
local toolBackup=
@@ -97,8 +97,8 @@ step_10() {
toolBackup="${toolDir}/${toolName}_bu"
fi
exe service ${toolName} stop >>/dev/null 2>&1
echoseq -n " [I] Backing up existing executable to ${toolBackup}..."
exe cp -ar "$toolLoc" "$toolBackup" && echoseq "ok"
info -n " [I] Backing up existing executable to ${toolBackup}..."
exe cp -ar "$toolLoc" "$toolBackup" && info "ok"
fi
}
versionNow=$([ ! -z $(which ${toolName}) ] && ${toolName} --version | sed 's/.*version: \([0-9.]\+\).*/\1/')
@@ -116,7 +116,7 @@ step_12_info() {
fi
echo
}
step_12_alias() { ALIAS="upgrade"; }
step_12_alias() { echo "upgrade"; }
step_12() {
step backup
exe wget -O "$toolLoc" $toolDownload
@@ -134,7 +134,7 @@ step_30_info() {
echoinfo " --arch, -a : armhf(default), arm64"
echoinfo " CPU architecture for downloading go sources"
}
step_30_alias() { ALIAS="build"; }
step_30_alias() { echo "build"; }
step_30() {
shift
local goVer="$(curl --silent -L https://go.dev/doc/devel/release | \
@@ -151,7 +151,7 @@ step_30() {
# Download latest go
if [ ! -e "${goDir}" ] ; then
echoseq "Download go${goVer}: ${goDownUrl}"
info "Download go${goVer}: ${goDownUrl}"
exe wget -O "${goDownLoc}" ${goDownUrl}
endReturn -o $? "Download ${goVer} failed"
exe tar -C "$(dirname -- "${goDir}")" -xzf "${goDownLoc}"
@@ -193,7 +193,7 @@ step_32() {
}
# Sequence Revision
VERSION_SEQREV=15
readonly sqr_minVersion=16
# Path to sequencer
. /usr/local/bin/sequencer.sh