Add Octoprint installer/remover

This commit is contained in:
th33xitus
2020-07-15 18:57:46 +02:00
parent 21aa2f45e5
commit fe27d054f8
6 changed files with 220 additions and 4 deletions

View File

@@ -77,6 +77,30 @@ mainsail_status(){
fi
}
octoprint_status(){
ocount=0
octoprint_data=(
$OCTOPRINT_DIR
$OCTOPRINT_CFG_DIR
$OCTOPRINT_SERVICE1
$OCTOPRINT_SERVICE2
)
#count+1 for each found data-item from array
for op in "${octoprint_data[@]}"
do
if [ -e $op ]; then
ocount=$(expr $ocount + 1)
fi
done
if [ "$ocount" == "${#octoprint_data[*]}" ]; then
OCTOPRINT_STATUS="${green}Installed!${default} "
elif [ "$ocount" == 0 ]; then
OCTOPRINT_STATUS="${red}Not installed!${default} "
else
OCTOPRINT_STATUS="${yellow}Incomplete!${default} "
fi
}
read_branch(){
if [ -d $KLIPPER_DIR ] && [ -d $KLIPPER_DIR/.git ]; then
cd $KLIPPER_DIR