feat(sprout): added uninstall to latest sprout

This commit is contained in:
Ethan Holz
2023-11-06 11:58:57 -06:00
parent 6906325e71
commit 8904d89814

View File

@@ -22,20 +22,21 @@ case $arch in
;; ;;
esac esac
if [ ! -f /etc/grlx/sprout ]; then if [ -z "$UNINSTALL" ]; then
mkdir -p /etc/grlx if [ ! -f /etc/grlx/sprout ]; then
if [ -z "$FARMERINTERFACE" ]; then mkdir -p /etc/grlx
echo "FARMERINTERFACE is not set. Please set it to the domain or IP of your farmer." if [ -z "$FARMERINTERFACE" ]; then
exit 1 echo "FARMERINTERFACE is not set. Please set it to the domain or IP of your farmer."
fi exit 1
if [ -z "$FARMERAPIPORT" ]; then fi
FARMERAPIPORT=5405 if [ -z "$FARMERAPIPORT" ]; then
fi FARMERAPIPORT=5405
if [ -z "$FARMERBUSPORT" ]; then fi
FARMERBUSPORT=5406 if [ -z "$FARMERBUSPORT" ]; then
fi FARMERBUSPORT=5406
fi
cat << EOF > /etc/grlx/sprout cat << EOF > /etc/grlx/sprout
farmerinterface: $FARMERINTERFACE farmerinterface: $FARMERINTERFACE
farmerbusport: $FARMERBUSPORT farmerbusport: $FARMERBUSPORT
farmerapiport: $FARMERAPIPORT farmerapiport: $FARMERAPIPORT
@@ -64,5 +65,11 @@ Group=root
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
systemctl daemon-reload systemctl daemon-reload
systemctl enable --now grlx-sprout systemctl enable --now grlx-sprout
else
systemctl disable --now grlx-sprout
rm -f /etc/systemd/system/grlx-sprout.service
rm -f /usr/local/bin/grlx-sprout
rm -rf /etc/grlx
fi