sync_from_old_server.sh: fix function 'service_exists'; some minor changes in script output.

This commit is contained in:
Christoph 2023-12-10 12:07:43 +01:00
parent 35a7b3a8a5
commit 1ac27093e9

View File

@ -247,7 +247,7 @@ detect_mysql_version () {
service_exists() { service_exists() {
local n=$1 local n=$1
if [[ $(systemctl list-units --all -t service --full --no-legend "$n.service" | cut -f1 -d' ') == $n.service ]]; then if [[ $(systemctl list-units --all -t service --full --no-legend "$n.service" | awk '{print$1}') == $n.service ]]; then
return 0 return 0
else else
return 1 return 1
@ -310,7 +310,7 @@ else
fi fi
echononl " Create temporary file \033[31m\033[1m/root/.ssh/config\033[m .." echononl " Create temporary file \033[1m/root/.ssh/config\033[m .."
cat <<EOF > "/root/.ssh/config" cat <<EOF > "/root/.ssh/config"
Host * Host *
ControlMaster auto ControlMaster auto
@ -1022,7 +1022,7 @@ else
fi fi
echononl " Restore file \033[31m\033[1m/root/.ssh/config\033[m .." echononl " Restore file \033\033[1m/root/.ssh/config\033[m .."
if [[ -f "/root/.ssh/config.${cur_date}" ]] ; then if [[ -f "/root/.ssh/config.${cur_date}" ]] ; then
mv "/root/.ssh/config.${cur_date}" "/root/.ssh/config" > /dev/null 2> $tmp_err_msg mv "/root/.ssh/config.${cur_date}" "/root/.ssh/config" > /dev/null 2> $tmp_err_msg
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then