diff --git a/Config/User/user.sh b/Config/User/user.sh index 985ca08..1125928 100644 --- a/Config/User/user.sh +++ b/Config/User/user.sh @@ -77,8 +77,8 @@ case $pick in echo "系统内没有该用户" exit fi - sed -i "s/^#\?$user_name.*/d" /etc/sudoers - pkill -u root + sed -i "s/^#\?$user_name.*/d" /etc/sudoers &> /dev/null + pkill -u $user_name userdel -r $user_name &> /dev/null rm -rf "/home/${user_name}" echo "用户删除成功" diff --git a/Menus/Install.sh b/Menus/Install.sh index 98667ba..965b3c1 100644 --- a/Menus/Install.sh +++ b/Menus/Install.sh @@ -1,12 +1,16 @@ #!/bin/bash +if [[ $UID != 0 ]]; then + echo "请以root权限执行该脚本" + exit +fi if ! command -v git &> /dev/null; then if [[ -f "/usr/bin/apt-get" ]];then apt-get update -y - apt-get install git + apt-get install git -y elif [[ -f "/usr/bin/apt" ]];then apt update -y - apt install git + apt install git -y elif [[ -f "/usr/bin/pacman" ]];then pacman -Syu --noconfirm pacman -Sy --noconfirm git