sync_from_old_server.sh: fix function 'service_exists'; some minor changes in script output.
This commit is contained in:
parent
35a7b3a8a5
commit
1ac27093e9
@ -247,7 +247,7 @@ detect_mysql_version () {
|
||||
|
||||
service_exists() {
|
||||
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
|
||||
else
|
||||
return 1
|
||||
@ -310,7 +310,7 @@ else
|
||||
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"
|
||||
Host *
|
||||
ControlMaster auto
|
||||
@ -1022,7 +1022,7 @@ else
|
||||
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
|
||||
mv "/root/.ssh/config.${cur_date}" "/root/.ssh/config" > /dev/null 2> $tmp_err_msg
|
||||
if [[ $? -eq 0 ]] ; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user