-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
58 lines (46 loc) · 1.3 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
set -e
required_commands=("wget" "curl" "unzip" "nft")
for cmd in "${required_commands[@]}"; do
if command -v "$cmd" > /dev/null 2>&1; then
echo "Checking $cmd >> OK!"
else
echo "$cmd is not installed. Please install it first."
exit 1
fi
done
ARCHITECTURE=$(uname -m)
case $ARCHITECTURE in
x86_64)
ARCH="amd64"
;;
armv7l)
ARCH="arm"
;;
aarch64)
ARCH="arm64"
;;
mips64)
ARCH="mips64"
;;
*)
echo "Unsupported ARCHITECTURE >_< : $ARCHITECTURE"
exit 1
;;
esac
ZIPNAME="LanceLight-linux-$ARCH.zip"
FILENAME="llfctl-$ARCH"
wget "https://github.com/nexryai/lance-light/releases/latest/download/$ZIPNAME"
unzip $ZIPNAME
rm $ZIPNAME
mv $FILENAME /usr/bin/llfctl
curl https://raw.githubusercontent.com/nexryai/lance-light/main/systemd/lance.service > /etc/systemd/system/lance.service
if [ ! -f /etc/lance.yml ]; then
curl https://raw.githubusercontent.com/nexryai/lance-light/main/config.default.yml > /etc/lance.yml
fi
# restoreconがあるならSELinuxに怒られないようにする
if command -v restorecon >/dev/null 2>&1; then
restorecon -R /usr/bin/llfctl
fi
systemctl daemon-reload
echo "Lance Light has been installed successfully. enjoy! :)"