mirror of
https://github.com/gogrlx/bootstrap.grlx.dev.git
synced 2026-04-02 02:59:05 -07:00
add v0.0.13
This commit is contained in:
68
v0.0.13/sprout
Executable file
68
v0.0.13/sprout
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e -o pipefail
|
||||
|
||||
arch=$(uname -m)
|
||||
|
||||
case $arch in
|
||||
"x86_64")
|
||||
machine_arch="amd64"
|
||||
;;
|
||||
"i686"|"i386")
|
||||
machine_arch="x86"
|
||||
;;
|
||||
"aarch64"|"arm64"|"armv8")
|
||||
machine_arch="arm64"
|
||||
;;
|
||||
"armv7l")
|
||||
machine_arch="arm"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown machine architecture: $arch"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ! -f /etc/grlx/sprout ]; then
|
||||
mkdir -p /etc/grlx
|
||||
if [ -z "$FARMERINTERFACE" ]; then
|
||||
echo "FARMERINTERFACE is not set. Please set it to the domain or IP of your farmer."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$FARMERAPIPORT" ]; then
|
||||
FARMERAPIPORT=5405
|
||||
fi
|
||||
if [ -z "$FARMERBUSPORT" ]; then
|
||||
FARMERBUSPORT=5406
|
||||
fi
|
||||
|
||||
cat << EOF > /etc/grlx/sprout
|
||||
farmerinterface: $FARMERINTERFACE
|
||||
farmerbusport: $FARMERBUSPORT
|
||||
farmerapiport: $FARMERAPIPORT
|
||||
EOF
|
||||
fi
|
||||
chmod 600 /etc/grlx/sprout
|
||||
|
||||
curl -s "https://artifacts.grlx.dev/linux/${machine_arch}/v0.0.13/sprout" > /usr/local/bin/grlx-sprout
|
||||
chmod +x /usr/local/bin/grlx-sprout
|
||||
|
||||
cat << EOF > /etc/systemd/system/grlx-sprout.service
|
||||
[Unit]
|
||||
Description=grlx sprout
|
||||
Documentation=https://docs.grlx.dev
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/grlx-sprout
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
User=root
|
||||
Group=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now grlx-sprout
|
||||
Reference in New Issue
Block a user