From a9132b15adb3ec38e5bd97b25616c8224a41999b Mon Sep 17 00:00:00 2001 From: "xiongdian.me" Date: Thu, 5 Jan 2023 22:55:58 +0800 Subject: [PATCH] try fix when su doesnot exist --- tools/get.dotfiles.cn | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/get.dotfiles.cn b/tools/get.dotfiles.cn index 1e84b15..583367d 100644 --- a/tools/get.dotfiles.cn +++ b/tools/get.dotfiles.cn @@ -33,7 +33,12 @@ while [[ $# > 0 || -n "$ARG" ]]; do done # install -su $DFS_USER << EOF +if command -v su 1>/dev/null; then + SUCMD="su $DFS_USER" +else + SUCMD="bash" +fi +$SUCMD << EOF cd if [[ ! -f ~/dotfiles/install.sh ]]; then git clone https://gitee.com/dictxiong/dotfiles