work/setup/runuser.sh

27 lines
698 B
Bash
Raw Normal View History

2020-04-11 18:55:50 +00:00
#!/bin/bash
TD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
# original home
OH="/hostroot/home/$USER_TO_ADD"
# container home
export HOME="/home/$USER_TO_ADD"
rsync -avP /home/template/ $HOME/
# link ~/.home to original home
ln -s "/hostroot/home/$USER_TO_ADD" $HOME/.home
# oh-my-zsh
curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh > /tmp/installomz.sh
export ZSH="$HOME/.zsh"
bash /tmp/installomz.sh --unattended --keep-zshrc
# link in ssh key from original home
ln -s ~/.home/.ssh/id_rsa ~/.ssh/id_rsa
ln -s ~/.home/.ssh/id_rsa.pub ~/.ssh/id_rsa.pub
# move this to runtime
#DEVDIR="$( cd ~/.home/dev >/dev/null 2>&1 && pwd -P)"