Skip to content

Instantly share code, notes, and snippets.

@sadiqsalau
Last active February 7, 2025 16:53
Show Gist options
  • Save sadiqsalau/8644e414379b0a9eee8a35d527e966b4 to your computer and use it in GitHub Desktop.
Save sadiqsalau/8644e414379b0a9eee8a35d527e966b4 to your computer and use it in GitHub Desktop.
Telegram Portable Updater and Backuper
#!/usr/bin/bash
# Directory Structure
# _BACKUP
# _BINARY
# _BASE
echo "Cleanup Previous Backup"
rm -rf _BACKUP telegram-accounts-backup.zip
echo "Setting Up Backup Directory"
mkdir _BACKUP
echo "Creating Backups..."
find . -mindepth 1 -maxdepth 1 -type d ! -name _BINARY ! -name _BASE ! -name _BACKUP \
-exec cp --parents -t _BACKUP \
{}/TelegramForcePortable/tdata/key_datas \
{}/TelegramForcePortable/tdata/D877F783D5D3EF8Cs \
{}/TelegramForcePortable/tdata/D877F783D5D3EF8C/maps \;
echo "Zipping Backup..."
zip -qr telegram-accounts-backup.zip \
_BACKUP \
_BASE \
backup.sh \
updater.sh;
#!/usr/bin/bash
# Directory Structure
# _BACKUP
# _BINARY
# _BASE
echo "Updating Telegram Binary..."
find . -mindepth 1 -maxdepth 1 -type d ! -name _BINARY ! -name _BASE ! -name _BACKUP \
-exec rm -rf "{}/TelegramForcePortable/tupdates" \; \
-exec rm -rf "{}/Telegram" \; \
-exec ln _BINARY/Telegram -f -t {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment