ellie-bash-installer/e-download.sh

36 lines
1 KiB
Bash
Raw Normal View History

2024-06-25 02:02:29 -07:00
#!/bin/sh
root=$(pwd)
2024-06-25 03:22:09 -07:00
wget -q -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/detectOS.sh
bash detectOS.sh > /dev/null || exit $?
2024-06-25 02:02:29 -07:00
# remove old backup but store the database
if [ -d elliebot_old/output/data/ ]; then
2024-06-25 03:22:09 -07:00
if [ -f elliebot_old/output/data/EllieBot.db ]; then
2024-06-25 02:02:29 -07:00
if [ ! -d elliebot_db_backups/ ]; then
mkdir elliebot_db_backups
fi
2024-06-25 03:22:09 -07:00
date_now=$(date +%s)
cp elliebot_old/output/data/EllieBot.db elliebot_db_backups/EllieBot-"$date_now".db
if [ -f elliebot_old/output/creds.yml ]; then
cp elliebot_old/output/creds.yml elliebot_db_backups/creds-"$date_now".yml
fi
2024-06-25 02:02:29 -07:00
fi
fi
rm -rf elliebot_old 1>/dev/null 2>&1
# make a new backup
mv -fT elliebot elliebot_old 1>/dev/null 2>&1
# clone new version
2024-06-25 03:22:09 -07:00
git clone -b v5 --recursive --depth 1 https://toastielab.dev/Emotions-stuff/elliebot
2024-06-25 02:02:29 -07:00
2024-06-25 03:22:09 -07:00
wget -q -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/rebuild.sh
2024-06-25 02:02:29 -07:00
bash rebuild.sh
cd "$root"
rm "$root/e-download.sh"
exit 0