Skip to content

Instantly share code, notes, and snippets.

@kopiro
Last active October 11, 2023 13:44
Show Gist options
  • Save kopiro/c5cce6d43833875e565fe8daa085aad6 to your computer and use it in GitHub Desktop.
Save kopiro/c5cce6d43833875e565fe8daa085aad6 to your computer and use it in GitHub Desktop.
Automatic Flipper Zero upgrade from UberGuidoZ repository
#!/bin/bash
FLIPPER_APPS_DIR="/tmp/UberGuidoZFlipper"
FLIPPER_SD_DIR="/Volumes/Flipper SD"
if [ ! -d "$FLIPPER_SD_DIR" ]; then
echo "Flipper SD card not found at $FLIPPER_SD_DIR"
exit 1
fi
if [ ! -d "$FLIPPER_APPS_DIR" ]; then
echo "UberGuidoZ repo not found - cloning now"
git clone --recurse-submodules --remote-submodules git@github.com:UberGuidoZ/Flipper.git "$FLIPPER_APPS_DIR"
fi
pushd "$FLIPPER_APPS_DIR" || exit
echo "Updating repo..."
git fetch origin && git reset --hard origin/main && git submodule update --init --recursive
echo "Syncing to SD card..."
RSYNC_OPTS="-r --exclude='.git' --exclude='.gitattributes' --exclude='.gitignore' --exclude='.github'"
echo "Syncing apps..."
rsync $RSYNC_OPTS "./Applications/Custom (UL, RM, XFW)/Unleashed (Extras)/" "$FLIPPER_SD_DIR/apps/Extras"
echo "Syncing subghz..."
rsync $RSYNC_OPTS "./Sub-GHz/" "$FLIPPER_SD_DIR/subghz"
echo "Syncing infrared..."
cp ./Infrared/*.ir "$FLIPPER_SD_DIR/infrared/assets/"
for dir in "badusb" "infrared" "nfc" "subplaylist" "unirf"; do
echo "Syncing $dir..."
rsync $RSYNC_OPTS "./$dir/" "$FLIPPER_SD_DIR/$dir"
done
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment