#! /sbin/sh
# /system/addon.d/75-dnscrypt.sh

. /tmp/backuptool.functions

list_files() {
cat << EOF
etc/dnscrypt-proxy/dnscrypt-resolvers.csv
etc/dnscrypt-proxy/minisign.pub
etc/init.d/99dnscrypt
lib/libsodium.so
xbin/dnscrypt-proxy
xbin/dnscrypt
xbin/hostip
EOF
}

case "$1" in
  backup)
    list_files | while read FILE DUMMY; do
      backup_file $S/"$FILE"
    done
  ;;
  restore)
    list_files | while read FILE REPLACEMENT; do
      R=""
      [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
      [ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
    done
  ;;
  pre-backup)
    # Stub
  ;;
  post-backup)
    # Stub
  ;;
  pre-restore)
    # Stub
  ;;
  post-restore)
    # Stub
  ;;
esac
