-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.sh
executable file
·33 lines (28 loc) · 919 Bytes
/
build.sh
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
#!/bin/bash
if [[ "$1" =~ ^--help|-h$ ]]; then
echo "Usage: sudo ./build.sh [--acu] [--admin] [--ddev] [--dht] [--gps] [--help] [-i]"
echo " [--kiosk] [--launch] [--pt] [--reboot] [--sd]"
echo " [--skip-upgrade] [--tarp]"
echo ""
echo "The options --acu, --admin, --dht, and --kiosk can be followed by an extra"
echo "dash (e.g. --acu-) to clear a previously enabled option."
exit
fi
if [ "$EUID" != 0 ]; then
echo "This installer must be run as root (sudo ./build.sh)"
exit
fi
sudo -u "$SUDO_USER" bash -c ./build_node_check.sh
if [ -f "node_path.txt" ]; then
path="$(cat node_path.txt)"
rm node_path.txt
if [ "$path" == "failed" ]; then
exit;
elif [ -n "$path" ]; then
args=(--path \""$path"\")
path="${args[*]}"
fi
fi
echo "Starting main installer..."
# shellcheck disable=SC2090,SC2048,SC2086
node build.js -p $path --bash $*