Skip to content

Commit

Permalink
Running on K1 now
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Nov 20, 2023
1 parent ad8c48d commit ab4612b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions scripts/funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ cfg_existed() {
}

is_k1() {
if [ -n "$CREALITY_VARIANT" -a $CREALITY_VARIANT = "k1" ]; then
return 1
else
if [ -n "$CREALITY_VARIANT" -a "$CREALITY_VARIANT" = "k1" ]; then
return 0
else
return 1
fi
}

Expand Down
24 changes: 12 additions & 12 deletions scripts/install_creality.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ rm -rf $OBICO_DIR
rm -rf $OBICO_DIR/../moonraker-obico-env
EOF

if [ $CREALITY_VARIANT = "sonic_pad" ]; then
if is_k1; then

cat <<EOF
rm -f /etc/init.d/moonraker_obico_service
rm -f /etc/rc.d/S67moonraker_obico_service
rm -f /etc/rc.d/K1moonraker_obico_service
rm -f /etc/init.d/S99moonraker_obico
EOF

elif [ $CREALITY_VARIANT = "k1" ]; then
else

cat <<EOF
rm -f /etc/init.d/S99moonraker_obico
rm -f /etc/init.d/moonraker_obico_service
rm -f /etc/rc.d/S67moonraker_obico_service
rm -f /etc/rc.d/K1moonraker_obico_service
EOF

fi
Expand Down Expand Up @@ -101,17 +101,12 @@ prompt_for_variant_if_needed() {
fi
}

MOONRAKER_CONFIG_FILE="${MOONRAKER_CONF_DIR}/moonraker.conf"
OBICO_CFG_FILE="${MOONRAKER_CONF_DIR}/moonraker-obico.cfg"
OBICO_UPDATE_FILE="${MOONRAKER_CONF_DIR}/moonraker-obico-update.cfg"
OBICO_LOG_FILE="${MOONRAKER_LOG_DIR}/moonraker-obico.log"

# Parse command line arguments
while getopts "sku" arg; do
case $arg in
s) CREALITY_VARIANT="sonic_pad" ;;
k) CREALITY_VARIANT="k1" ;;
u) uninstall ;;
u) prompt_for_variant_if_needed && uninstall ;;
*) usage && exit 1;;
esac
done
Expand All @@ -126,6 +121,11 @@ else
MOONRAKER_LOG_DIR="/mnt/UDISK/printer_logs"
fi

MOONRAKER_CONFIG_FILE="${MOONRAKER_CONF_DIR}/moonraker.conf"
OBICO_CFG_FILE="${MOONRAKER_CONF_DIR}/moonraker-obico.cfg"
OBICO_UPDATE_FILE="${MOONRAKER_CONF_DIR}/moonraker-obico-update.cfg"
OBICO_LOG_FILE="${MOONRAKER_LOG_DIR}/moonraker-obico.log"

welcome
ensure_deps

Expand Down

0 comments on commit ab4612b

Please sign in to comment.