dotfiles/setup.sh

39 lines
1,006 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
2023-01-26 14:49:35 -05:00
cp ./.bash* /root
2022-12-17 12:37:42 -05:00
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-26 14:49:35 -05:00
cp ./nanorc /etc/nanorc
2023-01-22 14:23:01 -05:00
# changes PS1 prompts
2023-01-23 12:22:04 -05:00
SERV_COLOR="32"
2023-01-22 14:37:41 -05:00
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
2023-01-23 15:01:50 -05:00
PS1='\[\033[$RED\]\u\[\033[01;38;5;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
#PS1='\[\033[$RED\]\u\[\033[01;${SERV_COLOR}m\]@\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-23 15:01:50 -05:00
PS1='\[\033[$GREEN\]\u\[\033[01;38;5;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
#PS1='\[\033[$GREEN\]\u\[\033[01;${SERV_COLOR}m\]@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
2023-01-22 14:23:01 -05:00
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"