fix: -f 使用双引号无法正确解析 ~

This commit is contained in:
Konano 2023-07-22 15:03:09 +08:00
parent 4945bdd752
commit b5e9fed54e
2 changed files with 12 additions and 12 deletions

View File

@ -36,7 +36,7 @@ check_google_access() {
}
configure_ssh() {
[ -f "~/.ssh/authorized_keys" ] && return
[ -f ~/.ssh/authorized_keys ] && return
read -p "要配置 .ssh 吗?[Y/n]: " response
@ -47,7 +47,7 @@ configure_ssh() {
}
configure_ssh_keygen() {
[ -f "~/.ssh/id_ed25519.pub" ] && return
[ -f ~/.ssh/id_ed25519.pub ] && return
read -p "要生成 sshkey 吗?[y/N]: " response
@ -59,7 +59,7 @@ configure_ssh_keygen() {
}
configure_nano() {
[ -f "~/.nanorc" ] && return
[ -f ~/.nanorc ] && return
read -p "要配置 nano 吗?[Y/n]: " response
@ -108,7 +108,7 @@ configure_apt_install() {
}
configure_zsh() {
[ -f "~/.zshrc" ] && return
[ -f ~/.zshrc ] && return
read -p "要配置 zsh 吗?[Y/n]: " response
@ -128,7 +128,7 @@ configure_zsh() {
}
configure_tmux() {
[ -f "~/.tmux.conf" ] && return
[ -f ~/.tmux.conf ] && return
read -p "要配置 tmux 吗?[Y/n]: " response
@ -145,7 +145,7 @@ configure_tmux() {
}
configure_iptables() {
[ -f "/etc/network/if-pre-up.d/iptables-load" ] && return
[ -f /etc/network/if-pre-up.d/iptables-load ] && return
read -p "要配置 iptables 吗?[n/Y]: " response

View File

@ -36,7 +36,7 @@ check_google_access() {
}
configure_ssh() {
[ -f "~/.ssh/authorized_keys" ] && return
[ -f ~/.ssh/authorized_keys ] && return
read -p "要配置 .ssh 吗?[Y/n]: " response
@ -47,7 +47,7 @@ configure_ssh() {
}
configure_ssh_keygen() {
[ -f "~/.ssh/id_ed25519.pub" ] && return
[ -f ~/.ssh/id_ed25519.pub ] && return
read -p "要生成 sshkey 吗?[y/N]: " response
@ -59,7 +59,7 @@ configure_ssh_keygen() {
}
configure_nano() {
[ -f "~/.nanorc" ] && return
[ -f ~/.nanorc ] && return
read -p "要配置 nano 吗?[Y/n]: " response
@ -108,7 +108,7 @@ configure_apt_install() {
}
configure_zsh() {
[ -f "~/.zshrc" ] && return
[ -f ~/.zshrc ] && return
read -p "要配置 zsh 吗?[Y/n]: " response
@ -128,7 +128,7 @@ configure_zsh() {
}
configure_tmux() {
[ -f "~/.tmux.conf" ] && return
[ -f ~/.tmux.conf ] && return
read -p "要配置 tmux 吗?[Y/n]: " response
@ -145,7 +145,7 @@ configure_tmux() {
}
configure_iptables() {
[ -f "/etc/network/if-pre-up.d/iptables-load" ] && return
[ -f /etc/network/if-pre-up.d/iptables-load ] && return
read -p "要配置 iptables 吗?[n/Y]: " response