diff --git a/sync_from_old_server.sh b/sync_from_old_server.sh index e98c3fb..fb7d8d8 100755 --- a/sync_from_old_server.sh +++ b/sync_from_old_server.sh @@ -48,7 +48,7 @@ sync_web_dirs="" # - Sync Apache virtual host configurations # - # - Note - following files are excluded: -# - +# - # - 000-default.conf # - 000-dehydrated.conf # - 000-logformat.conf @@ -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 @@ -288,7 +288,7 @@ fi echononl " Backup file /root/bin/.ssh/config" if [[ -f "/root/.ssh/config" ]] ; then - mv "/root/.ssh/config " "/root/.ssh/config.${cur_date}" > /dev/null 2> $tmp_err_msg + mv "/root/.ssh/config" "/root/.ssh/config.${cur_date}" > /dev/null 2> $tmp_err_msg if [[ $? -eq 0 ]];then echo_ok else @@ -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 < "/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