Skip to content

Instantly share code, notes, and snippets.

@jasonmorganson
Last active August 15, 2018 18:31
Show Gist options
  • Save jasonmorganson/4733446 to your computer and use it in GitHub Desktop.
Save jasonmorganson/4733446 to your computer and use it in GitHub Desktop.
User configuration
#!/usr/bin/env sh
#
#
# Run with the following command:
#
#
#   wget -q -O - https://gist.github.com/jasonmorganson/4733446/raw/user.sh | sh
#   wget -q -O - http://user.morganson.net | sh
USER=jasonmorganson
USERHOME=/home/$USER
# Create user
sudo useradd -G sudo -s /bin/zsh -m -d $USERHOME $USER
echo ""
echo "Setup user profile for $USER in $USERHOME"
echo ""
# Setup dotfiles
if [ ! -d "$USERHOME/.dotfiles" ]]; then
echo -n "Getting dotfiles... "
sudo -u $USER git clone https://github.com/jasonmorganson/dotfiles.git $USERHOME/.dotfiles
sudo -u $USER cp $USERHOME/.dotfiles/.* $USERHOME
echo "done."
fi
echo ""
echo "All done."
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment