dotfiles/setup.sh
2023-01-23 14:14:55 -05:00

36 lines
802 B
Bash

#!/bin/bash
# updates all dotfiles on the system
rm ../../.bash* ../../.profile /root/.bash* /etc/nanorc ../../.PS1 /root/.PS1
ln ./.bash* /root
ln ./.bash* ../../
ln ./.profile ../../
rm /root/.bashrc /root/.profile
cp .bashrc /root
cp .profile /root
ln ./nanorc /etc/nanorc
# changes PS1 prompts
SERV_COLOR="32"
source ./setenv.sh
## root PS1
RED="01;31m"
cat << EOF >> /root/.PS1
PS1='\[\033[$RED\]\u\[\033[01;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
EOF
## user PS1
GREEN="01;32m"
cat << EOF >> ../../.PS1
PS1='\[\033[$GREEN\]\u\[\033[01;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
EOF
if [ -f ../../.env ] ; then
rm /etc/sudoers.d/user
echo "$USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/user
fi
echo "Install fzf, log out and log back in"