diff --git a/ansible/roles/kiwix/templates/kiwix-sync-torrents.sh.j2 b/ansible/roles/kiwix/templates/kiwix-sync-torrents.sh.j2 index d95d7dd..4a293b3 100644 --- a/ansible/roles/kiwix/templates/kiwix-sync-torrents.sh.j2 +++ b/ansible/roles/kiwix/templates/kiwix-sync-torrents.sh.j2 @@ -16,7 +16,8 @@ if [[ ! -f "$TORRENT_LIST" ]]; then fi # Get current torrents from transmission (extract names, skip header/footer) -current_torrents=$(transmission-remote -l 2>/dev/null | tail -n +2 | head -n -1 | awk '{print $NF}' || true) +# Note: Use sed '$d' instead of head -n -1 for macOS compatibility +current_torrents=$(transmission-remote -l 2>/dev/null | tail -n +2 | sed '$d' | awk '{print $NF}' || true) added=0 skipped=0