check all three vars

This commit is contained in:
2023-10-21 00:20:03 -07:00
parent 32b94188f7
commit c4e901df08
3 changed files with 67 additions and 49 deletions

View File

@@ -22,6 +22,28 @@ case $arch in
;; ;;
esac esac
if [ ! -f /etc/grlx/sprout ]; then
mkdir -p /etc/grlx
if [ -z "$FARMER_INTERFACE" ]; then
echo "FARMER_INTERFACE is not set. Please set it to the domain or IP of your farmer."
exit 1
fi
if [ -z "$FARMER_API_PORT" ]; then
FARMER_PORT=5405
fi
if [ -z "$FARMER_BUS_PORT" ]; then
FARMER_PORT=5406
fi
cat << EOF > /etc/grlx/sprout
farmerinterface: $FARMER_INTERFACE
farmerbusport: $FARMER_BUS_PORT
farmerapiport: $FARMER_API_PORT
farmerurl: https://$FARMER_INTERFACE:$FARMER_PORT
EOF
fi
chmod 600 /etc/grlx/sprout
curl -s "https://artifacts.grlx.dev/${machine_arch}/latest/sprout" > /usr/local/bin/grlx-sprout curl -s "https://artifacts.grlx.dev/${machine_arch}/latest/sprout" > /usr/local/bin/grlx-sprout
chmod +x /usr/local/bin/grlx-sprout chmod +x /usr/local/bin/grlx-sprout
@@ -43,21 +65,5 @@ Group=root
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
if [ ! -f /etc/grlx/sprout ]; then
mkdir -p /etc/grlx
if [ -z "$FARMER_INTERFACE" ]; then
echo "FARMER_INTERFACE is not set. Please set it to the domain or IP of your farmer."
exit 1
fi
if [ -z "$FARMER_PORT" ]; then
FARMER_PORT=5405
fi
cat << EOF > /etc/grlx/sprout
farmerinterface: $FARMER_INTERFACE
farmerurl: https://$FARMER_INTERFACE:$FARMER_PORT
EOF
fi
systemctl daemon-reload systemctl daemon-reload
systemctl enable --now grlx-sprout systemctl enable --now grlx-sprout

View File

@@ -22,6 +22,28 @@ case $arch in
;; ;;
esac esac
if [ ! -f /etc/grlx/sprout ]; then
mkdir -p /etc/grlx
if [ -z "$FARMER_INTERFACE" ]; then
echo "FARMER_INTERFACE is not set. Please set it to the domain or IP of your farmer."
exit 1
fi
if [ -z "$FARMER_API_PORT" ]; then
FARMER_PORT=5405
fi
if [ -z "$FARMER_BUS_PORT" ]; then
FARMER_PORT=5406
fi
cat << EOF > /etc/grlx/sprout
farmerinterface: $FARMER_INTERFACE
farmerbusport: $FARMER_BUS_PORT
farmerapiport: $FARMER_API_PORT
farmerurl: https://$FARMER_INTERFACE:$FARMER_PORT
EOF
fi
chmod 600 /etc/grlx/sprout
curl -s "https://artifacts.grlx.dev/${machine_arch}/v0.0.4/sprout" > /usr/local/bin/grlx-sprout curl -s "https://artifacts.grlx.dev/${machine_arch}/v0.0.4/sprout" > /usr/local/bin/grlx-sprout
chmod +x /usr/local/bin/grlx-sprout chmod +x /usr/local/bin/grlx-sprout
@@ -43,21 +65,5 @@ Group=root
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
if [ ! -f /etc/grlx/sprout ]; then
mkdir -p /etc/grlx
if [ -z "$FARMER_INTERFACE" ]; then
echo "FARMER_INTERFACE is not set. Please set it to the domain or IP of your farmer."
exit 1
fi
if [ -z "$FARMER_PORT" ]; then
FARMER_PORT=5405
fi
cat << EOF > /etc/grlx/sprout
farmerinterface: $FARMER_INTERFACE
farmerurl: https://$FARMER_INTERFACE:$FARMER_PORT
EOF
fi
systemctl daemon-reload systemctl daemon-reload
systemctl enable --now grlx-sprout systemctl enable --now grlx-sprout

View File

@@ -22,7 +22,29 @@ case $arch in
;; ;;
esac esac
curl -f -L -s "https://artifacts.grlx.dev/${machine_arch}/v0.0.5/sprout" > /usr/local/bin/grlx-sprout if [ ! -f /etc/grlx/sprout ]; then
mkdir -p /etc/grlx
if [ -z "$FARMER_INTERFACE" ]; then
echo "FARMER_INTERFACE is not set. Please set it to the domain or IP of your farmer."
exit 1
fi
if [ -z "$FARMER_API_PORT" ]; then
FARMER_PORT=5405
fi
if [ -z "$FARMER_BUS_PORT" ]; then
FARMER_PORT=5406
fi
cat << EOF > /etc/grlx/sprout
farmerinterface: $FARMER_INTERFACE
farmerbusport: $FARMER_BUS_PORT
farmerapiport: $FARMER_API_PORT
farmerurl: https://$FARMER_INTERFACE:$FARMER_PORT
EOF
fi
chmod 600 /etc/grlx/sprout
curl -s "https://artifacts.grlx.dev/${machine_arch}/v0.0.5/sprout" > /usr/local/bin/grlx-sprout
chmod +x /usr/local/bin/grlx-sprout chmod +x /usr/local/bin/grlx-sprout
cat << EOF > /etc/systemd/system/grlx-sprout.service cat << EOF > /etc/systemd/system/grlx-sprout.service
@@ -43,21 +65,5 @@ Group=root
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
if [ ! -f /etc/grlx/sprout ]; then
mkdir -p /etc/grlx
if [ -z "$FARMER_INTERFACE" ]; then
echo "FARMER_INTERFACE is not set. Please set it to the domain or IP of your farmer."
exit 1
fi
if [ -z "$FARMER_PORT" ]; then
FARMER_PORT=5405
fi
cat << EOF > /etc/grlx/sprout
farmerinterface: $FARMER_INTERFACE
farmerurl: https://$FARMER_INTERFACE:$FARMER_PORT
EOF
fi
systemctl daemon-reload systemctl daemon-reload
systemctl enable --now grlx-sprout systemctl enable --now grlx-sprout