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

@@ -15,25 +15,25 @@ SCRIPT_NAME=${SCRIPT_FILE%%.*}
CONFIG_FILE_NAME="${SCRIPT_NAME}.cfg"
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
step_config() {
seq_config() {
## or to use sequencer api with global config file:
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
if [ $? -eq 0 ] ; then
CONFIG=1
else
# End if no configuration file exists
[ $DRY -eq 0 ] && return -1
dry || return -1
fi
## Apt cmdline option to suppress user interaction
[ $QUIET -ne 0 ] && APTOPT="-y"
quiet && APTOPT="-y"
## Return of non zero value will abort the sequence
return 0
}
step_1_info() { echo "Install dependencies"; }
step_1_alias() { ALIAS="install"; }
step_1_alias() { echo "install"; }
step_1() {
exe apt install $toolDeps $APTOPT
}
@@ -44,14 +44,14 @@ step_2() {
exe adduser --disabled-password --disabled-login --home-dir "$CALWEB_USER_HOME" --gecos "" $CALWEB_USER
exe usermod -aG users $CALWEB_USER
else
echoseq " [W] User $CALWEB_USER already exists"
warning "User $CALWEB_USER already exists"
fi
if [ ! -e "$CALWEB_VENV_ROOT/bin" ]; then
exe python3 -m venv "$CALWEB_VENV_ROOT"
endReturn -o $? "Creating virtual environment failed"
exe chown -R ${CALWEB_USER}: "$CALWEB_BASE"
else
echoseq " [W] Virtual env. $CALWEB_VENV_ROOT already exists"
warning "Virtual env. $CALWEB_VENV_ROOT already exists"
fi
}
@@ -70,6 +70,8 @@ step_4() {
toolFeatures[$i]="$toolPipName[${toolFeatures[$i]}]"
done
exe ${CALWEB_VENV_ROOT}/bin/pip install "${toolFeatures[@]}"
# Needed for in-app update
exe chown -R "${CALWEB_USER}": "${CALWEB_VENV_ROOT}/lib/python*/site-packages/calibreweb"
}
step_5_info() { echo "Install systemd service"; }
@@ -86,16 +88,16 @@ step_6() {
}
step_15_info() { echo "Upgrade python pip"; }
step_15_alias() { ALIAS="upgradepip"; }
step_15_alias() { echo "upgradepip"; }
step_15()
{
exe ${CALWEB_VENV_ROOT}/bin/pip install --upgrade pip
}
step_100_info() { echo "Setup notes"; }
step_100_alias() { ALIAS="notes"; }
step_100_alias() { echo "notes"; }
step_100() {
outColor green
color green
cat <<NOTES_END
# Default admin login:
@@ -127,5 +129,5 @@ proxy_set_header X-Script-Name /calibre; # IMPORTANT: path has NO trai
NOTES_END
}
VERSION_SEQREV=15
readonly sqr_minVersion=16
. /usr/local/bin/sequencer.sh