distribution/packages/games/emulators/drastic/scripts/start_drastic.sh

53 lines
1.4 KiB
Bash
Raw Normal View History

2022-10-21 19:51:23 +00:00
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech)
. /etc/profile
if [ ! -d "/storage/.config/drastic/aarch64/drastic" ]; then
echo -e "=> ${OS_NAME} DRASTIC INSTALLATION"
echo -e "\nChecking for internet connection..."
2022-10-21 19:51:23 +00:00
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
2022-10-21 19:51:23 +00:00
echo -e "\nFetching Drastic..."
2022-10-21 19:51:23 +00:00
curl -Lo drastic.tar.gz https://github.com/brooksytech/JelosAddOns/raw/main/drastic.tar.gz
2022-10-21 19:51:23 +00:00
echo -e "\nExtracting...\n"
tar -xvf drastic.tar.gz
2022-10-21 19:51:23 +00:00
rm drastic.tar.gz
2022-10-21 19:51:23 +00:00
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
2022-10-21 19:51:23 +00:00
clear
2022-10-21 19:51:23 +00:00
else
echo -e "Please connect to the internet before starting Drastic for the first time..." 2>&1
2022-10-21 19:51:23 +00:00
sleep 5
clear
exit 1
fi
2022-10-21 19:51:23 +00:00
fi
2022-10-21 19:51:23 +00:00
if [ ! -d "/storage/.config/drastic/aarch64/drastic/config" ]; then
2022-10-21 20:34:59 +00:00
mkdir -p /storage/.config/drastic/aarch64/drastic/config
cp /usr/config/drastic/drastic.cfg /storage/.config/drastic/aarch64/drastic/config/drastic.cfg
2022-10-21 19:51:23 +00:00
fi
cd /storage/.config/drastic/aarch64/drastic/
./drastic "$1"
clear