-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·49 lines (40 loc) · 1.02 KB
/
uninstall.sh
File metadata and controls
executable file
·49 lines (40 loc) · 1.02 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
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PCW_DIR_DEFAULT="$(cd "${ROOT_DIR}/.." && pwd)/PyPNM-CMTS-WebUI"
PCW_DIR="${PCW_DIR_DEFAULT}"
PASS_THROUGH_ARGS=()
usage() {
cat <<'EOF'
PyPNM-WebUI Wrapper Uninstall
Delegates uninstall to unified PyPNM-CMTS-WebUI.
Usage:
./uninstall.sh [options]
Options:
--pcw-dir <path> Unified repo path (default: ../PyPNM-CMTS-WebUI)
--help, -h Show this help.
All other flags are forwarded to unified repo uninstall.sh.
EOF
}
while [[ $# -gt 0 ]]; do
case "$1" in
--pcw-dir)
shift
PCW_DIR="${1:-}"
;;
-h|--help)
usage
exit 0
;;
*)
PASS_THROUGH_ARGS+=("$1")
;;
esac
shift
done
if [[ ! -x "${PCW_DIR}/uninstall.sh" ]]; then
echo "[uninstall][error] Unified uninstall script not found: ${PCW_DIR}/uninstall.sh" >&2
echo "[uninstall][hint] Install unified repo first with ./install.sh" >&2
exit 1
fi
exec "${PCW_DIR}/uninstall.sh" "${PASS_THROUGH_ARGS[@]}"