2021-01-14 19:51:46 +01:00
|
|
|
#!/bin/sh
|
2021-01-15 01:23:55 +01:00
|
|
|
# Written by Netkas 14/01/2021
|
2021-01-14 19:51:46 +01:00
|
|
|
echo "### Initializing CoffeeHouse-Utils ###"
|
2021-01-15 01:23:55 +01:00
|
|
|
|
2021-01-14 19:51:46 +01:00
|
|
|
if [ ! -f /firstrun.pass ]; then
|
|
|
|
echo "(!) First run! Installing resources..."
|
|
|
|
|
2021-01-15 01:23:55 +01:00
|
|
|
echo "Intellivoid Provisioning"
|
|
|
|
echo "Running on x86_64 (docker) [PRODUCTION]"
|
|
|
|
echo " "
|
|
|
|
echo " ## Authentication Required "
|
|
|
|
read -p 'Enter your 25-50 character PAT: ' GIT_API_KEY
|
2021-01-14 19:51:46 +01:00
|
|
|
|
2021-01-15 01:23:55 +01:00
|
|
|
echo " #### Cloning CoffeeHousePy"
|
|
|
|
cd /
|
|
|
|
git clone https://${GIT_API_KEY}@github.com/Intellivoid/CoffeeHousePy.git
|
2021-01-14 19:51:46 +01:00
|
|
|
|
2021-01-15 01:23:55 +01:00
|
|
|
echo " #### Checking out production branch"
|
|
|
|
cd /CoffeeHousePy
|
2021-01-16 00:44:49 +01:00
|
|
|
git checkout master
|
2021-01-14 19:51:46 +01:00
|
|
|
|
2021-01-15 01:23:55 +01:00
|
|
|
echo " #### Setting permissions"
|
|
|
|
chmod a+x /CoffeeHousePy/Docker/coffeehouse
|
|
|
|
chmod a+x /CoffeeHousePy/Docker/installer
|
2021-01-14 19:51:46 +01:00
|
|
|
|
2021-01-15 01:23:55 +01:00
|
|
|
echo " #### Running installer"
|
2021-01-15 01:35:25 +01:00
|
|
|
/bin/bash /CoffeeHousePy/Docker/installer
|
2021-01-14 19:51:46 +01:00
|
|
|
|
2021-01-15 01:23:55 +01:00
|
|
|
echo "(+) Setting boot flag..."
|
|
|
|
touch /firstrun.pass
|
|
|
|
echo "[...] Restarting server in detached mode..."
|
|
|
|
else
|
|
|
|
echo "### Starting main execution point"
|
2021-01-15 01:35:25 +01:00
|
|
|
/bin/bash /CoffeeHousePy/Docker/coffeehouse
|
2021-01-09 01:43:27 +01:00
|
|
|
fi
|