diff --git a/init_priv.sh b/init_priv.sh index 8cdd22d..3ede419 100755 --- a/init_priv.sh +++ b/init_priv.sh @@ -109,6 +109,8 @@ configure_tmux() { } configure_docker() { + command_exists docker && return + if confirm_action "要安装 docker 吗?" "N"; then # 卸载旧版本 sudo apt remove docker docker-engine docker.io diff --git a/utils.sh b/utils.sh index 68c59c2..fee831a 100755 --- a/utils.sh +++ b/utils.sh @@ -53,6 +53,10 @@ confirm_action() { [[ $response =~ ^[Yy]$ ]] } +command_exists() { + command -v "$@" >/dev/null 2>&1; +} + # ============================================================ check_google_access