This Bash script updates the Phantombot software.
The bot script and the update script must be located in the home directory of the user, as recommended by Phantombot, e.g. /home/botuser/
. The user 'botuser' must have sudo privileges to start and stop the bot. It's important that both the script and the bot are located directly in the home directory and sudo privileges are available.
The script performs the following steps:
- Checks if the required commands are installed on the system.
- Checks if the Phantombot service is active and attempts to stop it.
- Checks for arguments passed when running the script and determines the version to be updated.
- Downloads the latest version of Phantombot release from Github.
- Moves the installed phantombot folder from phantombot to phantombot-old
- Extracts the downloaded ZIP archive to phantombot and copies the needed files from phantombot-old.
- (Optionally) Copies required files for Scripts, if desired.
- Sets the correct permissions for the executable files.
- Creates a compressed backup of the old bot with the current date.
Note: This script is provided as-is and should be used with caution. Please make sure to backup your bot and data before running the update script.