diff --git a/scripts/flash_klipper.sh b/scripts/flash_klipper.sh index 1f9409c..fa2e721 100644 --- a/scripts/flash_klipper.sh +++ b/scripts/flash_klipper.sh @@ -295,7 +295,7 @@ retrieve_id(){ fi 2>/dev/null } -check_usergroup_dialout(){ +function check_usergroup_dialout(){ if grep -q "dialout" Yes" + INSTALL_MJPG="true" + break;; + N|n|No|no) + echo -e "###### > No" + INSTALL_MJPG="false" + break;; + *) + print_unkown_cmd + print_msg && clear_msg;; + esac + done +} + #=================================================# #============== REMOVE MJPG-STREAMER =============# #=================================================# -remove_mjpg-streamer(){ +function remove_mjpg-streamer(){ ### remove MJPG-Streamer service if [ -e "${SYSTEMD}/webcamd.service" ]; then status_msg "Removing MJPG-Streamer service ..." diff --git a/scripts/moonraker-telegram-bot.sh b/scripts/moonraker-telegram-bot.sh index 220dacf..7888aed 100644 --- a/scripts/moonraker-telegram-bot.sh +++ b/scripts/moonraker-telegram-bot.sh @@ -22,12 +22,12 @@ KLIPPER_CONFIG="${HOME}/klipper_config" #=========== REMOVE MOONRAKERTELEGRAMBOT ===========# #===================================================# -install_MoonrakerTelegramBot(){ +function install_MoonrakerTelegramBot(){ MoonrakerTelegramBot_setup restart_MoonrakerTelegramBot } -MoonrakerTelegramBot_setup(){ +function MoonrakerTelegramBot_setup(){ source_kiauh_ini export klipper_cfg_loc dep=(virtualenv) @@ -48,7 +48,7 @@ MoonrakerTelegramBot_setup(){ #=========== REMOVE MOONRAKERTELEGRAMBOT ===========# #===================================================# -remove_MoonrakerTelegramBot(){ +function remove_MoonrakerTelegramBot(){ ### remove MoonrakerTelegramBot dir if [ -d "${MOONRAKER_TELEGRAM_BOT_DIR}" ]; then status_msg "Removing MoonrakerTelegramBot directory ..." @@ -93,7 +93,7 @@ remove_MoonrakerTelegramBot(){ #=========== UPDATE MOONRAKERTELEGRAMBOT ===========# #===================================================# -update_MoonrakerTelegramBot(){ +function update_MoonrakerTelegramBot(){ export KLIPPER_CONFIG stop_MoonrakerTelegramBot cd "${MOONRAKER_TELEGRAM_BOT_DIR}" @@ -107,7 +107,7 @@ update_MoonrakerTelegramBot(){ #=========== MOONRAKERTELEGRAMBOT STATUS ===========# #===================================================# -MoonrakerTelegramBot_status(){ +function MoonrakerTelegramBot_status(){ mtbcount=0 MoonrakerTelegramBot_data=( SERVICE @@ -137,7 +137,7 @@ MoonrakerTelegramBot_status(){ fi } -read_MoonrakerTelegramBot_versions(){ +function read_MoonrakerTelegramBot_versions(){ if [ -d "${MOONRAKER_TELEGRAM_BOT_DIR}" ] && [ -d "${MOONRAKER_TELEGRAM_BOT_DIR}/.git" ]; then cd "${MOONRAKER_TELEGRAM_BOT_DIR}" git fetch origin master -q @@ -149,7 +149,7 @@ read_MoonrakerTelegramBot_versions(){ fi } -compare_MoonrakerTelegramBot_versions(){ +function compare_MoonrakerTelegramBot_versions(){ unset MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL read_MoonrakerTelegramBot_versions if [ "${LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT}" != "${REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT}" ]; then diff --git a/scripts/network_functions.sh b/scripts/network_functions.sh index 4ba9a52..73f312e 100755 --- a/scripts/network_functions.sh +++ b/scripts/network_functions.sh @@ -1,4 +1,4 @@ -set_nginx_cfg(){ +function set_nginx_cfg(){ if [ "$SET_NGINX_CFG" = "true" ]; then #check for dependencies dep=(nginx) @@ -36,11 +36,11 @@ set_nginx_cfg(){ fi } -read_listen_port(){ +function read_listen_port(){ LISTEN_PORT=$(grep listen /etc/nginx/sites-enabled/$1 | head -1 | sed 's/^\s*//' | cut -d" " -f2 | cut -d";" -f1) } -detect_enabled_sites(){ +function detect_enabled_sites(){ #check if there is another UI config already installed #and reads the port they are listening on if [ -e /etc/nginx/sites-enabled/mainsail ]; then @@ -69,7 +69,7 @@ detect_enabled_sites(){ fi } -create_custom_hostname(){ +function create_custom_hostname(){ echo top_border echo -e "| You can change the hostname of this machine to use |" @@ -93,7 +93,7 @@ create_custom_hostname(){ done } -user_input_hostname(){ +function user_input_hostname(){ unset NEW_HOSTNAME unset HOSTNAME_VALID unset HOSTENAME_CONFIRM @@ -133,7 +133,7 @@ user_input_hostname(){ done } -set_hostname(){ +function set_hostname(){ if [ "$HOSTNAME_VALID" = "true" ] && [ "$HOSTENAME_CONFIRM" = "true" ]; then #check for dependencies dep=(avahi-daemon) diff --git a/scripts/pretty_gcode.sh b/scripts/pretty_gcode.sh index 0cf342c..22cd4c0 100644 --- a/scripts/pretty_gcode.sh +++ b/scripts/pretty_gcode.sh @@ -19,7 +19,7 @@ PGC_DIR="${HOME}/pgcode" #================== INSTALL PGC ==================# #=================================================# -install_pgc_for_klipper(){ +function install_pgc_for_klipper(){ pgconfsrc="${PGC_DIR}/pgcode.local.conf" pgconf="/etc/nginx/sites-available/pgcode.local.conf" pgconfsl="/etc/nginx/sites-enabled/pgcode.local.conf" @@ -57,7 +57,7 @@ install_pgc_for_klipper(){ #=================== REMOVE PGC ==================# #=================================================# -remove_prettygcode(){ +function remove_prettygcode(){ pgconf="/etc/nginx/sites-available/pgcode.local.conf" pgconfsl="/etc/nginx/sites-enabled/pgcode.local.conf" if [ -d "${HOME}/pgcode" ] || [ -f "${pgconf}" ] || [ -L "${pgconfsl}" ]; then @@ -76,7 +76,7 @@ remove_prettygcode(){ #=================== UPDATE PGC ==================# #=================================================# -update_pgc_for_klipper(){ +function update_pgc_for_klipper(){ PGC_DIR="${HOME}/pgcode" status_msg "Updating PrettyGCode for Klipper ..." cd "${PGC_DIR}" && git pull @@ -87,7 +87,7 @@ update_pgc_for_klipper(){ #=================== PGC STATUS ==================# #=================================================# -read_pgc_versions(){ +function read_pgc_versions(){ PGC_DIR="${HOME}/pgcode" if [ -d "${PGC_DIR}" ] && [ -d "${PGC_DIR}/.git" ]; then cd "${PGC_DIR}" @@ -100,7 +100,7 @@ read_pgc_versions(){ fi } -compare_pgc_versions(){ +function compare_pgc_versions(){ unset PGC_UPDATE_AVAIL read_pgc_versions if [ "${LOCAL_PGC_COMMIT}" != "${REMOTE_PGC_COMMIT}" ]; then