dotfiles/setup.sh

37 lines
748 B
Bash
Raw Normal View History

2023-01-22 14:23:01 -05:00
#!/bin/bash
# updates all dotfiles on the system
2023-01-22 14:37:41 -05:00
rm ../../.bash* ../../.profile /root/.bash* /etc/nanorc ../../.PS1 /root/.PS1
2022-12-17 12:37:42 -05:00
ln ./.bash* /root
ln ./.bash* ../../
2022-12-27 19:34:08 -05:00
ln ./.profile ../../
2022-12-17 12:42:26 -05:00
2022-12-28 15:38:02 -05:00
rm /root/.bashrc /root/.profile
2022-12-17 12:42:26 -05:00
cp .bashrc /root
2022-12-28 15:38:02 -05:00
cp .profile /root
2023-01-22 14:23:01 -05:00
ln ./nanorc /etc/nanorc
# changes PS1 prompts
2023-01-22 14:37:41 -05:00
SERV_COLOR=""
source ./setenv.sh
2022-12-17 12:42:26 -05:00
2023-01-22 14:23:01 -05:00
## root PS1
RED="01;31m"
cat << EOF >> /root/.PS1
PS1='\[\033[$RED\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
2022-12-17 01:22:43 -05:00
EOF
2023-01-22 14:23:01 -05:00
## user PS1
GREEN="01;32m"
2023-01-22 14:37:41 -05:00
cat << EOF >> ../../.PS1
2023-01-22 14:23:01 -05:00
PS1='\[\033[$GREEN\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
EOF
2023-01-08 10:40:46 -05:00
2023-01-22 14:37:41 -05:00
if [ -f ../../.env ] ; then
2023-01-08 10:40:46 -05:00
rm /etc/sudoers.d/user
2023-01-22 12:06:52 -05:00
echo "$USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/user
2023-01-08 10:40:46 -05:00
fi
echo "Install fzf, log out and log back in"