-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy.sh
More file actions
49 lines (43 loc) · 1.04 KB
/
Copy pathproxy.sh
File metadata and controls
49 lines (43 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/ash
# Route10 DNSCrypt proxy wrapper for operational scripts.
set -eu
PROJECT_DIR="$(cd "$(dirname "$0")" && pwd)"
SCRIPTS_DIR="${PROJECT_DIR}/scripts"
usage() {
cat <<'EOF'
Usage: proxy.sh <command> [args...]
Commands:
start [args...] Run scripts/start.sh
updater [args...] Run scripts/updater.sh
update-filters [args...] Run scripts/update-filters.sh
uninstall [args...] Run scripts/uninstall.sh
EOF
}
cmd="${1:-}"
if [ -z "$cmd" ]; then
usage
exit 1
fi
shift || true
case "$cmd" in
start|start.sh)
exec /bin/ash "${SCRIPTS_DIR}/start.sh" "$@"
;;
updater|updater.sh)
exec /bin/ash "${SCRIPTS_DIR}/updater.sh" "$@"
;;
update-filters|update-filters.sh|filters)
exec /bin/ash "${SCRIPTS_DIR}/update-filters.sh" "$@"
;;
uninstall|uninstall.sh)
exec /bin/ash "${SCRIPTS_DIR}/uninstall.sh" "$@"
;;
help|-h|--help)
usage
;;
*)
echo "Unknown command: $cmd" >&2
usage
exit 1
;;
esac