test
This commit is contained in:
parent
f608625e82
commit
a9489ef2df
@ -13,13 +13,13 @@ do
|
||||
DEPENDENCYNAME=$(echo "`basename $f | cut -f 1 -d '.'`")
|
||||
## Actual Package
|
||||
DEPENDENCYPACKAGE=`cat $f`
|
||||
echo "Checking For $DEPENDENCYNAME with package name $DEPENDENCYPACKAGE"
|
||||
echo "* Checking For $DEPENDENCYNAME with package name $DEPENDENCYPACKAGE"
|
||||
|
||||
if which $DEPENDENCYNAME >/dev/null;
|
||||
then
|
||||
echo " $DEPENDENCYNAME Is Already Installed."
|
||||
echo "** $DEPENDENCYNAME Is Already Installed."
|
||||
else
|
||||
echo " Installing $DEPENDENCYNAME"
|
||||
echo "** Installing $DEPENDENCYNAME"
|
||||
apt-get install -y $DEPENDENCYPACKAGE
|
||||
fi
|
||||
|
||||
@ -27,7 +27,7 @@ do
|
||||
then
|
||||
:
|
||||
else
|
||||
echo " Error Installing $DEPENDENCYNAME"
|
||||
echo "** Error Installing $DEPENDENCYNAME"
|
||||
fi
|
||||
## End Of loop
|
||||
done
|
||||
|
||||
@ -12,10 +12,13 @@ for f in $MOTDALL
|
||||
do
|
||||
## Name Of Package
|
||||
MOTDNAME=$(echo "`basename $f | cut -f 1 -d '.'`")
|
||||
echo "Checking For $MOTDNAME motd file"
|
||||
echo "* Checking For $MOTDNAME motd file"
|
||||
FILEBASENAME=$(echo "`basename $f`")
|
||||
if [ ! -f "$FILEBASENAME" ]; then
|
||||
echo "** $FILEBASENAME motd file Missing, copying"
|
||||
cp "$f" $MOTDDIR
|
||||
else
|
||||
echo "** $FILEBASENAME motd exists"
|
||||
fi
|
||||
## End Of loop
|
||||
done
|
||||
|
||||
@ -4,25 +4,27 @@ echo "Checking Topgrade Situation"
|
||||
## Script Location
|
||||
# SCRIPTDIR=$(dirname $0)
|
||||
|
||||
echo "Checking for topgrade directory"
|
||||
echo "* Checking for topgrade directory"
|
||||
topgrade_install_directory="/opt/topgrade"
|
||||
if [ ! -d "$topgrade_install_directory" ]; then
|
||||
echo "creating topgrade installation directory"
|
||||
echo "** creating topgrade installation directory"
|
||||
mkdir $topgrade_install_directory
|
||||
fi
|
||||
|
||||
echo "checking for topgrade binary"
|
||||
echo "* Checking for topgrade binary"
|
||||
topgrade_binary="/opt/topgrade/topgrade"
|
||||
topgrade_tar="/opt/topgrade/topgrade.tar.gz"
|
||||
topgrade_git_user="r-darwish"
|
||||
topgrade_git_repo="topgrade"
|
||||
if [ ! -f "$topgrade_binary" ]; then
|
||||
echo "topgrade binary missing, installing now"
|
||||
echo "** topgrade binary missing, installing now"
|
||||
curl -s -L "https://github.com/$topgrade_git_user/$topgrade_git_repo/releases/latest" | egrep -o '/$topgrade_git_user/$topgrade_git_repo/releases/download/[0-9]*/[0-9]*-x86_64-unknown-linux-gnu.tar.gz' | wget --base=http://github.com/ -i - -O "$topgrade_tar"
|
||||
tar -xvf $topgrade_tar -C $topgrade_install_directory
|
||||
else
|
||||
echo "** topgrade binary exists"
|
||||
fi
|
||||
if [ ! -f "$topgrade_binary" ]; then
|
||||
echo "topgrade nor present at $topgrade_binary"
|
||||
echo "** topgrade binary not present at $topgrade_binary"
|
||||
fi
|
||||
|
||||
|
||||
@ -30,15 +32,16 @@ echo "checking for topgrade confs"
|
||||
custom_topgrade_confs_path="/etc/topgrade"
|
||||
custom_topgrade_confs_git="https://git.deathbybandaid.net/deathbybandaid/topgrade.git"
|
||||
if [ ! -d "$custom_topgrade_confs_path" ]; then
|
||||
echo "Installing topgrade configs"
|
||||
echo "** Installing topgrade configs"
|
||||
git clone --quiet $custom_topgrade_confs_git $custom_topgrade_confs_path
|
||||
else
|
||||
echo "** Updating topgrade configs"
|
||||
git -C $custom_topgrade_confs_path pull
|
||||
fi
|
||||
|
||||
|
||||
## Update
|
||||
if [ -f "$topgrade_binary" ]; then
|
||||
echo "Running topgrade"
|
||||
echo "* Running topgrade"
|
||||
$topgrade_binary
|
||||
fi
|
||||
|
||||
@ -7,9 +7,10 @@ echo "Checking Custom Bash Aliases"
|
||||
custom_bash_aliases_path="/etc/bash_aliases"
|
||||
custom_bash_aliases_git="https://git.deathbybandaid.net/deathbybandaid/bash_aliases.git"
|
||||
if [ ! -d "$custom_bash_aliases_path" ]; then
|
||||
echo "Installing Bash Aliases"
|
||||
echo "* Installing Bash Aliases"
|
||||
git clone --quiet $custom_bash_aliases_git $custom_bash_aliases_path
|
||||
else
|
||||
echo "* Updating Bash Aliases"
|
||||
git -C $custom_bash_aliases_path pull
|
||||
fi
|
||||
source $HOME/.bashrc
|
||||
|
||||
@ -7,18 +7,19 @@ echo "Checking IPA Realm Join Status"
|
||||
|
||||
# TODO setup /etc/hosts with FQDN and FreeIPA servers
|
||||
|
||||
echo "Checking if system already contains Membership to FreeIPA Realm"
|
||||
realm_join=0
|
||||
if [[ ! -f /var/lib/ipa-client/sysrestore/sysrestore.state ]]
|
||||
then
|
||||
echo "$HOSTNAME appears to not be joined to FreeIPA Server Realm"
|
||||
realm_join=1
|
||||
else
|
||||
echo "$HOSTNAME appears to already be joined to FreeIPA Server Realm"
|
||||
fi
|
||||
|
||||
## FreeIPA Realm Join
|
||||
if (whiptail --title "FreeIPA Relam Join" --yes-button "yes" --no-button "no" --yesno "Do You want to join a FreeIPA Realm?" 10 80)
|
||||
then
|
||||
echo "Checking if system already contains Membership to FreeIPA Realm"
|
||||
realm_join=0
|
||||
if [[ ! -f /var/lib/ipa-client/sysrestore/sysrestore.state ]]
|
||||
then
|
||||
echo "$HOSTNAME appears to not be joined to FreeIPA Server Realm"
|
||||
realm_join=1
|
||||
else
|
||||
echo "$HOSTNAME appears to already be joined to FreeIPA Server Realm"
|
||||
fi
|
||||
|
||||
if [[ $HOSTNAME == *template* ]]; then
|
||||
echo "Hostname $HOSTNAME contains the word 'template', skipping realm joining"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user