-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
39 lines (32 loc) · 813 Bytes
/
install.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
34
35
36
37
38
39
#!/bin/bash
set -e
if [[ "$EUID" -ne 0 ]]; then
echo "ERROR: You must run this script as root" >&2
exit 1
fi
INSTALL_XRAY=0
INSTALL_WIREGUARD=0
if [[ $# -eq 0 ]]; then
INSTALL_XRAY=1
INSTALL_WIREGUARD=1
else
for arg in "$@"; do
case $arg in
xray ) INSTALL_XRAY=1;;
wireguard ) INSTALL_WIREGUARD=1;;
* ) echo "ERROR: Unexpected component '$arg'" >&2; exit 1;;
esac
done
fi
if [[ $INSTALL_WIREGUARD -eq 1 ]] || [[ $INSTALL_XRAY -eq 1 ]]; then
mkdir -p /usr/local/etc/veepeenet
cp ./meta.json /usr/local/etc/veepeenet/meta.json
fi
if [[ $INSTALL_XRAY -eq 1 ]]; then
printf '\n >>> INSTALLING VeePeeNET Xray\n'
source ./install-xray.sh
fi
if [[ $INSTALL_WIREGUARD -eq 1 ]]; then
printf '\n >>> INSTALLING VeePeeNET WireGuard\n'
source ./install-wg.sh
fi