try fix when su doesnot exist

This commit is contained in:
xiongdian.me 2023-01-05 22:55:58 +08:00
parent 320cf6c206
commit a9132b15ad

View File

@ -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