Files
fdroid-frajul/scripts/update-apks.sh
T
2026-06-30 10:01:34 +02:00

34 lines
826 B
Bash
Executable File

#!/usr/bin/env bash
# Put here all apk update scripts
UPDATE_SCRIPTS=(
"./scripts/apk-update-scripts/sheetless.sh"
)
for script in "${UPDATE_SCRIPTS[@]}"; do
echo "--------------------------------"
echo "Executing: $script"
# Run the script
$script
done
# Sync all apks from the mounted dir to dest
SOURCE="/apks/"
DEST="/src/code/fdroid/repo/"
HASH_BEFORE=$(stat -c "%A %h %U %G %s %n" "$DEST"* | sha256sum)
echo "Syncing apks in directory $DEST with $SOURCE..."
rsync -rv --include="*.apk" --exclude="*" --delete "$SOURCE" "$DEST"
HASH_AFTER=$(stat -c "%A %h %U %G %s %n" "$DEST"* | sha256sum)
if [ "$HASH_BEFORE" == "$HASH_AFTER" ]; then
echo "No APKs were added or removed. Skipping F-Droid update."
exit 0
else
echo "Changes detected! Files were copied or deleted."
exit 10
fi