Skip to content

Commit

Permalink
Fix ssh enable for OctoPrint
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasbakken committed Jun 5, 2024
1 parent c3aff46 commit 90e16b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions userpatches/overlay/bins/set-ssh-access
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions userpatches/overlay/install_components/moonraker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
3 changes: 0 additions & 3 deletions userpatches/overlay/install_components/post_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down

0 comments on commit 90e16b3

Please sign in to comment.