Skip to content

Commit

Permalink
make it possible to automatically run all steps without confirmation …
Browse files Browse the repository at this point in the history
…with an optional command line env variable
  • Loading branch information
pellcorp committed Feb 17, 2024
1 parent e755e58 commit 090b92b
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ if [ "$1" = "zbolt" ]; then
ASSET_NAME="$ASSET_NAME-zbolt"
fi

if [ -z "$GUPPYSCREEN_CONFIRM_PROMPTS" ]; then
GUPPYSCREEN_CONFIRM_PROMPTS="y"
fi

ARCH=`uname -m`
if [ "$ARCH" = "mips" ] && [ -f /sys/class/graphics/fb0/virtual_size ]; then
res=`cat /sys/class/graphics/fb0/virtual_size`
Expand Down Expand Up @@ -148,13 +152,17 @@ fi
## dropbear early to ensure ssh is started with display-server
cp $K1_GUPPY_DIR/k1_mods/S50dropbear /etc/init.d/S50dropbear

printf "${white}=== Do you want to disable all Creality services (revertable) with GuppyScreen installation? ===\n"
printf "${green} Pros: Frees up system resources on your K1 for critical services such as Klipper (Recommended)\n"
printf "${white} Cons: Disabling all Creality services breaks Creality Cloud/Creality Slicer.\n\n"
printf "Disable all Creality Services? (y/n): "
if [ "$GUPPYSCREEN_CONFIRM_PROMPTS" = "y" ]; then
printf "${white}=== Do you want to disable all Creality services (revertable) with GuppyScreen installation? ===\n"
printf "${green} Pros: Frees up system resources on your K1 for critical services such as Klipper (Recommended)\n"
printf "${white} Cons: Disabling all Creality services breaks Creality Cloud/Creality Slicer.\n\n"
printf "Disable all Creality Services? (y/n): "

read confirm_decreality
echo
read confirm_decreality
echo
else
confirm_decreality=y
fi

if [ "$confirm_decreality" = "y" -o "$confirm_decreality" = "Y" ]; then
printf "${green}Disabling Creality services ${white}\n"
Expand Down Expand Up @@ -199,10 +207,14 @@ if ! diff $K1_GUPPY_DIR/k1_mods/S50dropbear /etc/init.d/S50dropbear > /dev/null
exit 1
fi

## request to reboot
printf "Restart Klipper now to pick up the new changes (y/n): "
read confirm
echo
if [ "$GUPPYSCREEN_CONFIRM_PROMPTS" = "y" ]; then
## request to reboot
printf "Restart Klipper now to pick up the new changes (y/n): "
read confirm
echo
else
confirm=y
fi

if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then
echo "Restarting Klipper"
Expand Down

0 comments on commit 090b92b

Please sign in to comment.