Used sequpgrade.sh to upgrade existing seqs
This commit is contained in:
@@ -17,7 +17,7 @@ CONFIG=0
|
||||
CONFIG_FILE_NAME="${toolName}.cfg"
|
||||
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
|
||||
|
||||
step_config() {
|
||||
seq_config() {
|
||||
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
||||
if [ $? -eq 0 ] ; then
|
||||
echo " ${toolName} path: ${PFA_WEB_LOC}"
|
||||
@@ -33,12 +33,12 @@ step_1_info() {
|
||||
echo "Install $toolName dependencies:"
|
||||
echoinfo "$localDeps"
|
||||
}
|
||||
step_1_alias() { ALIAS="install"; }
|
||||
step_1_alias() { echo "install"; }
|
||||
step_1() {
|
||||
# eval needed to expand sourced configuration variables
|
||||
local localDeps=`eval "echo \"$toolPhpDeps\""`
|
||||
local aptOpt=
|
||||
if [ $QUIET -ne 0 ];then
|
||||
if quiet;then
|
||||
aptOpt="-y"
|
||||
fi
|
||||
exe apt update
|
||||
@@ -51,10 +51,10 @@ step_2() {
|
||||
}
|
||||
|
||||
step_3_info() { echo "Install fetchmail"; }
|
||||
step_3_alias() { ALIAS="install_fetchmail"; }
|
||||
step_3_alias() { echo "install_fetchmail"; }
|
||||
step_3() {
|
||||
local aptOpt=
|
||||
if [ $QUIET -ne 0 ];then
|
||||
if quiet;then
|
||||
aptOpt="-y"
|
||||
fi
|
||||
exe apt install $fetchmailDeps $aptOpt
|
||||
@@ -81,7 +81,7 @@ step_6_info() {
|
||||
echo "Create postfixadmin fetchmail systemd timer and reduce syslog entries"
|
||||
echoinfo "Needs to start after the mysql service"
|
||||
}
|
||||
step_6_alias() { ALIAS="timer"; }
|
||||
step_6_alias() { echo "timer"; }
|
||||
step_6() {
|
||||
# eval needed to expand sourced configuration variables
|
||||
local localService=`eval "echo \"$fetchPluginService\""`
|
||||
@@ -123,7 +123,7 @@ fetchPluginRsyslog="if \$programname == 'systemd' and re_match(\$msg, \"Started.
|
||||
if \$programname == 'systemd' and re_match(\$msg, \"fetchmail.*Succeeded\") then stop"
|
||||
|
||||
step_7_info() { echo "Create separate log file for fetchmail using rsyslog"; }
|
||||
step_7_alias() { ALIAS="newlog"; }
|
||||
step_7_alias() { echo "newlog"; }
|
||||
step_7() {
|
||||
addConf -f "$fetchmailRsyslog" "$fetchmailRsyslogLoc"
|
||||
addConf -f "$fetchmailRotate" "$fetchmailRotateLoc"
|
||||
@@ -144,7 +144,7 @@ fetchmailRsyslog="if \$programname == 'fetchmail' or \$programname == 'fetchmail
|
||||
& stop"
|
||||
|
||||
step_18_info() { echoinfoArgs "[NEW VERSION]"; echo "Check for updates"; }
|
||||
step_18_alias() { ALIAS="updatecheck"; }
|
||||
step_18_alias() { echo "updatecheck"; }
|
||||
step_18() {
|
||||
shift
|
||||
local isInstalled=
|
||||
@@ -175,12 +175,12 @@ step_20_info() {
|
||||
echo
|
||||
fi
|
||||
}
|
||||
step_20_alias() { ALIAS="backup"; }
|
||||
step_20_alias() { echo "backup"; }
|
||||
step_20() {
|
||||
shift
|
||||
local tempRoot=
|
||||
if [ $CONFIG -eq 0 ] ; then
|
||||
echoerr " [E] No configuration file found"
|
||||
error -e "No configuration file found"
|
||||
return 1
|
||||
fi
|
||||
if [ ! -z $PFA_BACKUP ] ; then
|
||||
@@ -203,7 +203,7 @@ step_20() {
|
||||
step_22_info() {
|
||||
echoinfoArgs "[CUSTOM VERSION]"
|
||||
shift
|
||||
if [ $CONTEXT_EXE -ne 0 ]; then
|
||||
if contextExe; then
|
||||
echoinfo -n "Upgrade to version "
|
||||
if [ -z "$1" ]; then
|
||||
echo -n "$(curl --silent "$latestUrl" | grep -Po '"tag_name": "postfixadmin-\K.*?(?=")')"
|
||||
@@ -215,7 +215,7 @@ step_22_info() {
|
||||
echo "Upgrade to latest or a custom version from github"
|
||||
fi
|
||||
}
|
||||
step_22_alias() { ALIAS="upgrade"; }
|
||||
step_22_alias() { echo "upgrade"; }
|
||||
step_22() {
|
||||
shift # don't need step number
|
||||
local latestVersion=
|
||||
@@ -226,16 +226,16 @@ step_22() {
|
||||
fi
|
||||
|
||||
if [ -z $latestVersion ] ; then
|
||||
echoerr " [E] Cannot determine latest version from github repository"
|
||||
error -e "Cannot determine latest version from github repository"
|
||||
return 1
|
||||
elif [ $QUIET -eq 0 ] ; then
|
||||
elif interactive ; then
|
||||
echo
|
||||
exe read -p "Install $latestVersion to $PFA_SRV_LOC [n]o/(y)es? " answer
|
||||
case $answer in
|
||||
[yY])
|
||||
;;
|
||||
*)
|
||||
echoerr " [I] Upgrade aborted"
|
||||
info -e "Upgrade aborted"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
@@ -245,7 +245,7 @@ step_22() {
|
||||
# Trailing ".0" is removed if exists
|
||||
local isInstalled=$(grep -E "Version ${latestVersion%.0} " "${PFA_SRV_LOC}/CHANGELOG.TXT" >>/dev/null 2>&1 && echo "1" || echo "0")
|
||||
if [ $isInstalled -eq 1 ] ; then
|
||||
echoerr " [E] Version $latestVersion is already installed"
|
||||
error -e "Version $latestVersion is already installed"
|
||||
return 2
|
||||
fi
|
||||
|
||||
@@ -308,7 +308,7 @@ tempDown="/tmp/${toolName}"
|
||||
tempLoc="$tempDown/${toolName}.tar.gz"
|
||||
|
||||
step_23_info() { echo "Clean temporary files: $tempDown"; }
|
||||
step_23_alias() { ALIAS="clean"; }
|
||||
step_23_alias() { echo "clean"; }
|
||||
step_23() {
|
||||
exe rm -rf "$tempDown"
|
||||
}
|
||||
@@ -318,11 +318,11 @@ step_100_info() {
|
||||
echo "Execute $toolName client script"
|
||||
echoinfo "[OPTIONS] are passed on to $toolName-cli unmodified"
|
||||
}
|
||||
step_100_alias() { ALIAS="cli"; }
|
||||
step_100_alias() { echo "cli"; }
|
||||
step_100() {
|
||||
shift
|
||||
exe ${PFA_SRV_LOC}/scripts/$toolName-cli $@
|
||||
}
|
||||
|
||||
VERSION_SEQREV=14
|
||||
readonly sqr_minVersion=16
|
||||
. /usr/local/bin/sequencer.sh
|
||||
|
Reference in New Issue
Block a user