Used sequpgrade.sh to upgrade existing seqs
This commit is contained in:
@@ -25,7 +25,7 @@ SCRIPT_NAME=${SCRIPT_FILE%%.*}
|
||||
CONFIG_FILE_NAME="${SCRIPT_NAME}.cfg"
|
||||
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
|
||||
|
||||
step_config() {
|
||||
seq_config() {
|
||||
## Called once before executing steps.
|
||||
## e.g. to source a config file manually:
|
||||
#. "$CONFIG_FILE"
|
||||
@@ -39,11 +39,11 @@ step_config() {
|
||||
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"
|
||||
|
||||
dockerDnsEntry="DOCKER_OPTS=\"--dns $dockerDns1 --dns $dockerDns2\""
|
||||
|
||||
@@ -52,7 +52,7 @@ step_config() {
|
||||
}
|
||||
|
||||
step_1_info() { echo "Install Docker dependencies"; }
|
||||
step_1_alias() { ALIAS="install"; }
|
||||
step_1_alias() { echo "install"; }
|
||||
step_1() {
|
||||
exe apt update
|
||||
exe apt install $dockerDeps $APTOPT
|
||||
@@ -74,7 +74,7 @@ step_2() {
|
||||
step_3_info() { echo "Install latest Docker version"; }
|
||||
step_3() {
|
||||
# Install the latest version
|
||||
if [ $QUIET -ne 0 ] ; then
|
||||
if quiet ; then
|
||||
aptOption="-y"
|
||||
else
|
||||
aptOption=""
|
||||
@@ -90,7 +90,7 @@ step_4() {
|
||||
exe sed -i "s/\(^#DOCKER_OPTS=.*\)$/#\1\n${dockerDnsEntry}/" "$dockerDefaultConf"
|
||||
exep "grep \"${dockerDns1}\" \"$dockerDefaultConf\" >>/dev/null"
|
||||
if [ $? -ne 0 ] ; then
|
||||
echoerr " [W] Docker dns entry could not be changed"
|
||||
warning -e "Docker dns entry could not be changed"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ step_5_info() {
|
||||
echoinfo "If [SECRET] is empty, user input will be available if not run --quiet."
|
||||
echoinfo "$toolName will be run unsecured if no secret was provied."
|
||||
}
|
||||
step_5_alias() { ALIAS="startoo"; }
|
||||
step_5_alias() { echo "startoo"; }
|
||||
step_5() {
|
||||
local options=
|
||||
local secret=
|
||||
@@ -109,7 +109,7 @@ step_5() {
|
||||
secret="$2"
|
||||
elif [ ! -z "$dockerSecret" ]; then
|
||||
secret="$dockerSecret"
|
||||
elif [ $QUIET -eq 0 ] ; then
|
||||
elif interactive ; then
|
||||
exe read -s -p "JWT Secret: " secret
|
||||
fi
|
||||
|
||||
@@ -124,7 +124,7 @@ step_5() {
|
||||
-v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \
|
||||
-v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql "${dockerImageName}"
|
||||
else
|
||||
echoerr " [W] Running $toolName without JWT (JSON Web Tokens)"
|
||||
warning -e "Running $toolName without JWT (JSON Web Tokens)"
|
||||
exe docker run -i -t -d -p ${onlyOfficePort}:80 --restart=always "${dockerImageName}"
|
||||
fi
|
||||
|
||||
@@ -132,7 +132,7 @@ step_5() {
|
||||
}
|
||||
|
||||
step_7_info() { echo "Upgrade $toolName to latest version"; }
|
||||
step_7_alias() { ALIAS="upgrade"; }
|
||||
step_7_alias() { echo "upgrade"; }
|
||||
step_7() {
|
||||
# get container ID
|
||||
local containerId=$(docker ps -aqf ancestor="$dockerImageName")
|
||||
@@ -140,7 +140,7 @@ step_7() {
|
||||
exe docker stop $containerId
|
||||
exe docker rm $containerId
|
||||
else
|
||||
echoerr " [W] No $toolName Docker container found"
|
||||
warning -e "No $toolName Docker container found"
|
||||
fi
|
||||
exe docker pull $dockerImageName
|
||||
endReturn -o $? "Error getting $toolName Docker update"
|
||||
@@ -149,7 +149,7 @@ step_7() {
|
||||
}
|
||||
|
||||
step_10_info() { echo "List running Docker container"; }
|
||||
step_10_alias() { ALIAS="ls"; }
|
||||
step_10_alias() { echo "ls"; }
|
||||
step_10() {
|
||||
exe docker container ls
|
||||
echo
|
||||
@@ -162,7 +162,7 @@ step_12_info() {
|
||||
echo "Clean unused Docker data"
|
||||
echoinfo "(unused containers, dangling images, networks, build cache and volumes)"
|
||||
}
|
||||
step_12_alias() { ALIAS="prune"; }
|
||||
step_12_alias() { echo "prune"; }
|
||||
step_12() {
|
||||
exe docker system df
|
||||
exe docker system prune
|
||||
@@ -170,13 +170,13 @@ step_12() {
|
||||
}
|
||||
|
||||
step_100_info() { echo "Uninstall Docker"; }
|
||||
step_100_alias() { ALIAS="uninstall"; }
|
||||
step_100_alias() { echo "uninstall"; }
|
||||
step_100() {
|
||||
exe apt-get purge docker-ce
|
||||
}
|
||||
|
||||
step_102_info() { echo "Purge images, containers, volumes, or customized configuration files"; }
|
||||
step_102_alias() { ALIAS="purge"; }
|
||||
step_102_alias() { echo "purge"; }
|
||||
step_102() {
|
||||
exe read -p "Are you sure y/[n]? " answer
|
||||
case $answer in
|
||||
@@ -190,5 +190,5 @@ step_102() {
|
||||
esac
|
||||
}
|
||||
|
||||
VERSION_SEQREV=15
|
||||
readonly sqr_minVersion=16
|
||||
. /usr/local/bin/sequencer.sh
|
||||
|
Reference in New Issue
Block a user