script: add more default trusted_clients to moonraker.conf template

the previous method of adding the host network range was too unreliable in some cases and didn't cover some popular usecases
This commit is contained in:
th33xitus
2021-07-11 19:13:37 +02:00
parent b44e855a98
commit 7984c28fe5
2 changed files with 13 additions and 3 deletions

View File

@@ -277,7 +277,13 @@ create_moonraker_conf(){
sed -i "s|%LOG%|$LOG_PATH|" $MR_CONF
sed -i "s|%MR_DB%|$MR_DB|" $MR_CONF
sed -i "s|%UDS%|$KLIPPY_UDS|" $MR_CONF
sed -i "s|%LAN%|$LAN|" $MR_CONF
# if host ip is not in the default ip ranges, replace placeholder
# otherwise remove placeholder from config
if ! grep $LAN $MR_CONF; then
sed -i "s|%LAN%|$LAN|" $MR_CONF
else
sed -i "/%LAN%/d" $MR_CONF
fi
sed -i "s|%USER%|${USER}|g" $MR_CONF
ok_msg "moonraker.conf created!"
else