1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

Merge pull request #3369 from tim-moody/7.3.6-misc

add utility scripts
This commit is contained in:
A Holt 2022-09-22 12:45:35 -04:00 committed by GitHub
commit 08508a6620
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 65 additions and 0 deletions

19
iiab-setup Executable file
View file

@ -0,0 +1,19 @@
#!/bin/bash -e
# Running from a git repo
# Assumes iiab repos are downloaded
apt -y update
apt -y full-upgrade
apt -y install git curl nano gawk wget pastebinit
cd /opt/iiab/iiab
scripts/ansible
mkdir -p /etc/iiab/install-flags
if [ ! -f /etc/iiab/local_vars.yml ]; then
cp /opt/iiab/iiab/vars/local_vars_none.yml /etc/iiab/local_vars.yml
fi
reboot

46
iiab-upgrade Executable file
View file

@ -0,0 +1,46 @@
#!/bin/bash -e
# Running from a git repo
if [ ! -f /etc/iiab/local_vars.yml ]; then
echo -e "\nEXITING: IIAB is not already installed so can't upgrade\n" >&2
exit 1
fi
echo -e "\nWARNING: Upgrades are not guaranteed to be compatible with previous installs\n" >&2
echo -e "\Please make sure you know what you are doing.\n" >&2
echo -e "\Press CTL-C to STOP or <enter> to continue.\n" >&2
read ans < /dev/tty
# check that latest version supports current OS
# N.B. install via adm cons assumes is on supported OS
cd /opt/iiab
rm -rf iiab-latest
git clone https://github.com/iiab/iiab --depth 1 iiab-latest
cd iiab-latest
scripts/local_facts.fact; rc=$?
if [ $rc -eq 0 ]; then # OS is supported
cd /opt/iiab
if [ ! -d iiab-installed ]; then
mv iiab iiab-installed
else
rm -rf iiab # in case run more than once
fi
mv iiab-latest iiab
cd iiab
cp scripts/local_facts.fact /etc/ansible/facts.d/local_facts.fact
echo -e "\nIIAB has been Upgraded\n"
else
echo -e "\nYour OS is not supported by the latest IIAB\n"
echo -e "Unable to Upgrade IIAB\n"
fi
echo -e "\Press CTL-C to STOP or <enter> to upgrade Admin Console.\n" >&2
read ans < /dev/tty
cd /opt/iiab/iiab-admin-console
git pull
./install
echo -e "IIAB Admin Console has been Upgraded\n\n"