Update start_drastic to fix a simple logic bug and improve output a bit.

This commit is contained in:
fewtarius 2022-10-25 07:03:07 -04:00
parent 94bf8ae907
commit 9f225e1f95
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A

View file

@ -6,40 +6,41 @@
if [ ! -d "/storage/.config/drastic/aarch64/drastic" ]; then
echo "Drastic emulator not installed." 2>&1
echo "Checking for internet connection" 2>&1
echo -e "=> ${OS_NAME} DRASTIC INSTALLATION"
echo -e "\nChecking for internet connection..."
INETUP=$(ping -c1 -w1 www.google.com >/dev/null 2>&1)
if [ $? == 0 ]
then
echo "Downloading Drastic" 2>&1
mkdir -p "/storage/.config/drastic/aarch64"
cd /storage/.config/drastic/aarch64
INETUP=$(ping -c1 -w1 www.google.com >/dev/null 2>&1)
if [ $? == 0 ]
then
mkdir -p "/storage/.config/drastic/aarch64"
cd /storage/.config/drastic/aarch64
wget https://github.com/brooksytech/JelosAddOns/raw/main/drastic.tar.gz
echo -e "\nFetching Drastic..."
tar -xvf drastic.tar.gz
curl -Lo drastic.tar.gz https://github.com/brooksytech/JelosAddOns/raw/main/drastic.tar.gz
rm drastic.tar.gz
echo -e "\nExtracting...\n"
tar -xvf drastic.tar.gz
if [ ! -d "/storage/.config/drastic/aarch64/drastic/config" ]; then
mkdir -p /storage/.config/drastic/aarch64/drastic/config
cp /usr/config/drastic/drastic.cfg /storage/.config/drastic/aarch64/drastic/config/drastic.cfg
rm drastic.tar.gz
if [ ! -d "/storage/.config/drastic/aarch64/drastic/config" ]; then
mkdir -p /storage/.config/drastic/aarch64/drastic/config
cp /usr/config/drastic/drastic.cfg /storage/.config/drastic/aarch64/drastic/config/drastic.cfg
fi
clear
else
echo -e "Please connect to the internet before starting Drastic for the first time..." 2>&1
sleep 5
clear
exit 1
fi
cd /storage/.config/drastic/aarch64/drastic/
./drastic "$1"
else
echo "Please connect to the internet first." 2>&1
fi
sleep 5
clear
else
if [ ! -d "/storage/.config/drastic/aarch64/drastic/config" ]; then
mkdir -p /storage/.config/drastic/aarch64/drastic/config
cp /usr/config/drastic/drastic.cfg /storage/.config/drastic/aarch64/drastic/config/drastic.cfg
@ -48,5 +49,4 @@ fi
cd /storage/.config/drastic/aarch64/drastic/
./drastic "$1"
fi
clear