diff --git a/userpatches/overlay/bins/set-ssh-access b/userpatches/overlay/bins/set-ssh-access index d90a26d..cbb34bd 100644 --- a/userpatches/overlay/bins/set-ssh-access +++ b/userpatches/overlay/bins/set-ssh-access @@ -1,13 +1,13 @@ #!/bin/bash -IS_ENABLED=$1 +IS_ACTIVE=$1 -if [ "x${IS_ENABLED}" == "xtrue" ]; then - systemctl enable ssh +if [ "${IS_ACTIVE}" == "true" ]; then systemctl start ssh -elif [ "x${IS_ENABLED}" == "xfalse" ]; then + sed -i 's/^SSH_ENABLED_ON_BOOT.*/SSH_ENABLED_ON_BOOT=true/' /etc/rebuild-settings +elif [ "${IS_ACTIVE}" == "false" ]; then systemctl stop ssh - systemctl disable ssh + sed -i 's/^SSH_ENABLED_ON_BOOT.*/SSH_ENABLED_ON_BOOT=false/' /etc/rebuild-settings else echo "usage $0 true/false" exit 1 diff --git a/userpatches/overlay/install_components/moonraker.sh b/userpatches/overlay/install_components/moonraker.sh index 4617fac..f9df9b6 100644 --- a/userpatches/overlay/install_components/moonraker.sh +++ b/userpatches/overlay/install_components/moonraker.sh @@ -11,4 +11,7 @@ install_moonraker(){ cp /tmp/overlay/moonraker/moonraker-"${UI}".conf /home/debian/printer_data/config/moonraker.conf cp /tmp/overlay/moonraker/moonraker.asvc /home/debian/printer_data/ chown debian:debian moonraker /home/debian/printer_data/moonraker.asvc + + # Start moonraker only after armbian-firstrun + sed -i 's/After=.*/After=network-online.target armbian-firstrun.service/' /etc/systemd/system/moonraker.service } diff --git a/userpatches/overlay/install_components/post_build.sh b/userpatches/overlay/install_components/post_build.sh index 51afc0d..ce4ee12 100644 --- a/userpatches/overlay/install_components/post_build.sh +++ b/userpatches/overlay/install_components/post_build.sh @@ -15,9 +15,6 @@ post_build() { # armbian-firstrun needs to be type=oneshot in order to the autodisable to wait for it. sed -i 's/Type=.*/Type=oneshot/' /lib/systemd/system/armbian-firstrun.service - # Start moonraker only after armbian-firstrun - sed -i 's/After=.*/After=network-online.target armbian-firstrun.service/' /etc/systemd/system/moonraker.service - # Enable SSH service discovery cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/