Initial Push of scraped files for ansible
This commit is contained in:
28
files/scripts/bashrc/deploy-bashrc.sh
Executable file
28
files/scripts/bashrc/deploy-bashrc.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script deploys a custom bashrc to the Userhomes on nodes
|
||||
|
||||
# Vars
|
||||
BASHRC_URL=https://config.voser.cloud/linux/bash/bashrc
|
||||
BASHRC_TMP_PATH=/tmp/bashrc
|
||||
|
||||
# Information Gatering
|
||||
## Get the bashrc
|
||||
curl -k $BASHRC_URL > $BASHRC_TMP_PATH
|
||||
|
||||
#Script
|
||||
## Get the Userhomes & Write BASHRC to USERhome
|
||||
for USER in $(ls /home/*/ -d | cut -d "/" -f 3)
|
||||
do
|
||||
cp $BASHRC_TMP_PATH /home/$USER/.bashrc
|
||||
chown $USER /home/$USER/.bashrc
|
||||
chgrp $USER /home/$USER/.bashrc
|
||||
done
|
||||
|
||||
## Write the Custom bash to the Root Usershome directory
|
||||
cp $BASHRC_TMP_PATH /root/.bashrc
|
||||
chown root /root/.bashrc
|
||||
chgrp root /root/.bashrc
|
||||
|
||||
# Remove temporary Bashrc
|
||||
rm -f $BASHRC_TMP_PATH
|
||||
Reference in New Issue
Block a user