add command_exists
This commit is contained in:
parent
f207a7f2b5
commit
e85db23b7a
@ -109,6 +109,8 @@ configure_tmux() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configure_docker() {
|
configure_docker() {
|
||||||
|
command_exists docker && return
|
||||||
|
|
||||||
if confirm_action "要安装 docker 吗?" "N"; then
|
if confirm_action "要安装 docker 吗?" "N"; then
|
||||||
# 卸载旧版本
|
# 卸载旧版本
|
||||||
sudo apt remove docker docker-engine docker.io
|
sudo apt remove docker docker-engine docker.io
|
||||||
|
|||||||
4
utils.sh
4
utils.sh
@ -53,6 +53,10 @@ confirm_action() {
|
|||||||
[[ $response =~ ^[Yy]$ ]]
|
[[ $response =~ ^[Yy]$ ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
command_exists() {
|
||||||
|
command -v "$@" >/dev/null 2>&1;
|
||||||
|
}
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
||||||
check_google_access
|
check_google_access
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user