Initial Push of scraped files for ansible

This commit is contained in:
janic
2021-12-06 10:08:12 +01:00
parent 7aa8e04057
commit dc5b5a665d
7 changed files with 7753 additions and 2 deletions

View 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