Files
mcr-bot/update.sh
2023-06-23 13:22:50 +02:00

30 lines
596 B
Bash

#!/bin/bash
git fetch
if [ "$(git rev-parse HEAD)" != "$(git rev-parse "@{u}")" ]; then
git stash && git pull
cd .. && chmod +x ./*.sh
exec "$0"
fi
if [ ! -d "accounts" ]; then
mkdir "accounts"
fi
if [ ! -d "vpn" ]; then
mkdir "vpn"
fi
if [ ! -d "Microsoft-Rewards-bot" ]; then
git clone https://git.justw.tf/Lightemerald/Microsoft-Rewards-bot
fi
sudo dnf up -y
cd Microsoft-Rewards-bot && git fetch
if [ "$(git rev-parse HEAD)" != "$(git rev-parse "@{u}")" ]; then
git stash && git pull && pip install -r requirements.txt
fi
cd .. && chmod +x ./*.sh
clear
echo "Update done!"