Basic install script, still needs MariaDB logic
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "-----------------------------------------"
|
||||
echo "Swarmops Release Candidate script running"
|
||||
echo "-----------------------------------------"
|
||||
echo " "
|
||||
|
||||
ISDEBIAN=$(cat /etc/os-release | grep "ID=debian" | wc -l)
|
||||
ISUBUNTU=$(cat /etc/os-release | grep "ID=ubuntu" | wc -l)
|
||||
|
||||
# detect operating system
|
||||
|
||||
if [[ $ISDEBIAN -gt 0 ]]; then
|
||||
echo "Debian detected"
|
||||
elif [[ $ISUBUNTU -gt 0 ]]; then
|
||||
@@ -12,4 +19,58 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# remove the autoexecuting commands, if there were
|
||||
# any before
|
||||
|
||||
if [ -f /home/rick/.profile ]; then
|
||||
rm /home/rick/.profile
|
||||
fi
|
||||
|
||||
# detect if running as root already; if not, add sudo to
|
||||
# required commands
|
||||
|
||||
SUDO=''
|
||||
|
||||
if [ $EUID -ne 0 ]; then
|
||||
SUDO='sudo'
|
||||
fi
|
||||
|
||||
echo "Step 1 - autoremoving, updating, and upgrading packages:"
|
||||
echo " "
|
||||
|
||||
$SUDO apt -y autoremove
|
||||
$SUDO apt -y update
|
||||
$SUDO apt -y upgrade
|
||||
|
||||
if [ -f /var/run/reboot-required ]; then
|
||||
echo "./install-release-candidate.sh" > /home/rick/.profile
|
||||
echo " "
|
||||
echo "After upgrading, a REBOOT is required to continue."
|
||||
echo "The script will continue when you ssh to the machine after reboot."
|
||||
echo " "
|
||||
read -p "Press ENTER to reboot..."
|
||||
$SUDO reboot now
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "Step 2 - Installing MySQL or MariaDB server:"
|
||||
echo " "
|
||||
|
||||
$SUDO apt -y install mysql-server
|
||||
|
||||
if [ $ISDEBIAN -gt 0 ]; then
|
||||
echo " "
|
||||
echo "Step 3 - Configuring MariaDB for root@localhost login"
|
||||
echo " "
|
||||
echo "TODO"
|
||||
else
|
||||
echo " "
|
||||
echo "Step 3 - No configuration of MySQL required, skipped"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "Step 4 - Installing Swarmops Release Candidate:"
|
||||
echo " "
|
||||
|
||||
$SUDO apt -y install swarmops-frontend-rc swarmops-backend-rc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user