Skip to content

Commit

Permalink
Merge pull request guysoft#614 from OutsourcedGuru/OG_safemode
Browse files Browse the repository at this point in the history
Added safemode script to toggle on Safe Mode once
  • Loading branch information
guysoft authored Nov 26, 2019
2 parents a1bb66c + 8358499 commit 07bdb86
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/modules/octopi/filesystem/home/pi/scripts/safemode
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

if grep -q "startOnceInSafeMode" ~/.octoprint/config.yaml;
then
# If found,replace the existing line
sed -i 's/.*startOnceInSafeMode: false.*/\ \ startOnceInSafeMode: true/' ~/.octoprint/config.yaml
else
# Append otherwise
sed -i '/server:/a \ \ startOnceInSafeMode: true' ~/.octoprint/config.yaml
fi

0 comments on commit 07bdb86

Please sign in to comment.