18 lines
524 B
Bash
18 lines
524 B
Bash
#!/bin/sh
|
|
|
|
TARGET_USER=$1
|
|
|
|
FILE=/home/$TARGET_USER/.oh-my-zsh/oh-my-zsh.sh
|
|
if [ -f "$FILE" ]; then
|
|
echo "$FILE exists and we not installing ohmyzsh"
|
|
exit 0
|
|
else
|
|
echo "$FILE does not exist and we install ohmyzsh"
|
|
cd /home/$TARGET_USER
|
|
sudo -u $TARGET_USER wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
|
|
chmod +x /home/$TARGET_USER/install.sh
|
|
sudo -u $TARGET_USER timeout -s 15 -k 30s 20s /home/$TARGET_USER/install.sh --unattendend --keep-zshrc || exit 0
|
|
exit 0
|
|
fi
|
|
|