#!/bin/sh
set -eu
umask 077

FILES="
usr/local/sbin/router-egress-health-repair-watch.sh
usr/local/sbin/router-egress-emergency-decision-hook.sh
usr/local/sbin/router-egress-emergency-refresh.sh
usr/local/sbin/router-egress-hmn-plan-top5.sh
usr/local/sbin/router-egress-hmn-rebalance-top5-apply.sh
usr/local/lib/router-egress-recovery-state.sh
root/hmn/hmn-refresh-pool-safe.sh
etc/init.d/router-egress-health-repair
etc/init.d/router-egress-emergency-decision
etc/init.d/router-egress-slots
etc/init.d/router-egress-mapper
"

EXISTING=""

for path in $FILES; do
  if [ -f "/$path" ]; then
    EXISTING="$EXISTING $path"
  fi
done

[ -n "$EXISTING" ]

tar -C / -cf - $EXISTING
