feat: KIAUH v4.0.0 #191
@@ -295,7 +295,7 @@ retrieve_id(){
|
||||
fi 2>/dev/null
|
||||
}
|
||||
|
||||
check_usergroup_dialout(){
|
||||
function check_usergroup_dialout(){
|
||||
if grep -q "dialout" </etc/group && ! grep -q "dialout" <(groups "${USER}"); then
|
||||
group_dialout=false
|
||||
else
|
||||
|
||||
@@ -22,7 +22,7 @@ KLIPPER_CONFIG="${HOME}/klipper_config"
|
||||
#============== INSTALL KLIPPERSCREEN ==============#
|
||||
#===================================================#
|
||||
|
||||
install_klipperscreen(){
|
||||
function install_klipperscreen(){
|
||||
python3_check
|
||||
if [ "${py_chk_ok}" = "true" ]; then
|
||||
klipperscreen_setup
|
||||
@@ -33,7 +33,7 @@ install_klipperscreen(){
|
||||
fi
|
||||
}
|
||||
|
||||
python3_check(){
|
||||
function python3_check(){
|
||||
status_msg "Your Python 3 version is: $(python3 --version)"
|
||||
major=$(python3 --version | cut -d" " -f2 | cut -d"." -f1)
|
||||
minor=$(python3 --version | cut -d"." -f2)
|
||||
@@ -45,7 +45,7 @@ python3_check(){
|
||||
fi
|
||||
}
|
||||
|
||||
klipperscreen_setup(){
|
||||
function klipperscreen_setup(){
|
||||
dep=(wget curl unzip dfu-util)
|
||||
dependency_check
|
||||
status_msg "Downloading KlipperScreen ..."
|
||||
@@ -63,7 +63,7 @@ klipperscreen_setup(){
|
||||
#=============== REMOVE KLIPPERSCREEN ==============#
|
||||
#===================================================#
|
||||
|
||||
remove_klipperscreen(){
|
||||
function remove_klipperscreen(){
|
||||
source_kiauh_ini
|
||||
|
||||
### remove KlipperScreen dir
|
||||
@@ -110,7 +110,7 @@ remove_klipperscreen(){
|
||||
#=============== UPDATE KLIPPERSCREEN ==============#
|
||||
#===================================================#
|
||||
|
||||
update_klipperscreen(){
|
||||
function update_klipperscreen(){
|
||||
stop_klipperscreen
|
||||
cd "${KLIPPERSCREEN_DIR}"
|
||||
KLIPPERSCREEN_OLDREQ_MD5SUM=$(md5sum "${KLIPPERSCREEN_DIR}/scripts/KlipperScreen-requirements.txt" | cut -d " " -f1)
|
||||
@@ -131,7 +131,7 @@ update_klipperscreen(){
|
||||
#=============== KLIPPERSCREEN STATUS ==============#
|
||||
#===================================================#
|
||||
|
||||
klipperscreen_status(){
|
||||
function klipperscreen_status(){
|
||||
klsccount=0
|
||||
klipperscreen_data=(
|
||||
SERVICE
|
||||
@@ -161,7 +161,7 @@ klipperscreen_status(){
|
||||
fi
|
||||
}
|
||||
|
||||
read_klipperscreen_versions(){
|
||||
function read_klipperscreen_versions(){
|
||||
if [ -d "${KLIPPERSCREEN_DIR}" ] && [ -d "${KLIPPERSCREEN_DIR}/.git" ]; then
|
||||
cd "${KLIPPERSCREEN_DIR}"
|
||||
git fetch origin master -q
|
||||
@@ -173,7 +173,7 @@ read_klipperscreen_versions(){
|
||||
fi
|
||||
}
|
||||
|
||||
compare_klipperscreen_versions(){
|
||||
function compare_klipperscreen_versions(){
|
||||
unset KLIPPERSCREEN_UPDATE_AVAIL
|
||||
read_klipperscreen_versions
|
||||
if [ "${LOCAL_KLIPPERSCREEN_COMMIT}" != "${REMOTE_KLIPPERSCREEN_COMMIT}" ]; then
|
||||
|
||||
@@ -20,7 +20,7 @@ WEBCAM_TXT_SRC="https://raw.githubusercontent.com/mainsail-crew/MainsailOS/maste
|
||||
#============= INSTALL MJPG-STREAMER =============#
|
||||
#=================================================#
|
||||
|
||||
install_mjpg-streamer(){
|
||||
function install_mjpg-streamer(){
|
||||
check_klipper_cfg_path
|
||||
source_kiauh_ini
|
||||
|
||||
@@ -148,11 +148,35 @@ EOF
|
||||
echo
|
||||
}
|
||||
|
||||
function get_user_selection_mjpg-streamer(){
|
||||
while true; do
|
||||
unset INSTALL_MJPG
|
||||
echo
|
||||
top_border
|
||||
echo -e "| Install MJGP-Streamer for webcam support? |"
|
||||
bottom_border
|
||||
read -p "${cyan}###### Install MJPG-Streamer? (Y/n):${default} " yn
|
||||
case "${yn}" in
|
||||
Y|y|Yes|yes|"")
|
||||
echo -e "###### > 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 ..."
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user