Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shutdown
- 1. Auf dem NAS Userdaten für ssh finden/ ssh aktivieren..
- 1.1 Es kommt auf das Derivat und die jeweilige Systemstruktur an, z.B. Poweroff, shutdown oder auch reboot
- 1.2 Dazu kommt noch ob für den Shutdown Befehl ein sudo,su oder auch garnichts nötig ist
- 2. Auf dem raspberry muss "apt-get install sshpass" installiert werden
- 3. Befehl im raspberry ausprobieren(komplette Zeile kopieren und schauen was beim NAS passiert, ggf halt manuell in der Shell nachschauen, hier sollte man mindestens einmal eingeloggt gewesen sein):
- echo "sudo poweroff"|sshpass -p 'SYNOLOGYPASSWORT' ssh -o StrictHostKeyChecking=no -lSYNOLOGYUSER SYNOLOGYIP
- oder
- echo "echo 'SYNOLOGIEROOTPASSWORT'| su -c shutdown"|sshpass -p 'SYNOUSERPW' ssh -o StrictHostKeyChecking=no -lSYNOUSER SYNOIP
- 4. Raspbmc shutdownscript einrichten
- 4.1. cd /etc/init.d
- 4.2. sudo nano rechnersd (wenn kein nano dann vorher "Apt-get install nano")
- 8. Diesen text einfügen:
- #! /bin/sh
- ### BEGIN INIT INFO
- # Provides: rechnersd
- # Required-Start:
- # Required-Stop: sendsigs
- # Default-Start:
- # Default-Stop: 0 6
- # Short-Description: bla
- # Description:
- ### END INIT INFO
- PATH=/sbin:/usr/sbin:/bin:/usr/bin
- . /lib/lsb/init-functions
- do_stop () {
- FUNKTIONIERENDE ZEILE VON OBEN MIT ALLEM DRUM UND DRAN AUSGEFÜLLT
- }
- case "$1" in
- start)
- # No-op
- ;;
- restart|reload|force-reload)
- echo "Error: argument '$1' not supported" >&2
- exit 3
- ;;
- stop)
- do_stop
- ;;
- *)
- echo "Usage: $0 start|stop" >&2
- exit 3
- ;;
- esac
- :
- 9. JETZT STRG+O (O=Out/Schreiben) ENTER, und STRG+X
- 10. Abschluss: sudo update-rc.d rechnersd start 1 0 6
- in die Konsole eingeben..
- 11. ShutdownScript fertig
- Wakeup
- 1. Auf dem Rasperry wakeonlan installieren.
- sudo apt-get install wakeonlan
- 2. Manuell überprüfen das das Signal den ZielRechner / Nas erreicht.
- 2.1 bei Speedports und anderen Routern kann es beim MagicPacket zu problemen kommen, hier soll helfen die einzige einzelumleitung UDP Port 9 auf die Ziel IP Weiterzuleiten.
- 3. Nochmal ausführen:
- cd /etc/init.d/
- 4. anschliessend:
- sudo nano wakeup
- 5. Text einfügen:
- #! /bin/sh
- # /etc/init.d/wakeup
- #
- # Some things that run always
- wakeonlan MAC-ADRESSE
- # Carry out specific functions when asked to by the system
- case "$1" in
- start)
- echo "Starting script wakeup "
- echo "Could do more here"
- ;;
- stop)
- echo "Stopping script wakeup"
- echo "Could do more here"
- ;;
- *)
- echo "Usage: /etc/init.d/blah {start|stop}"
- exit 1
- ;;
- esac
- exit 0
- 6. JETZT STRG+O (O=Out/Schreiben) ENTER, und STRG+X
- 7. Noch zum Abschluss:
- update-rc.d wakeup defaults
- 8. Fertig und Reboot ;)
Advertisement
Add Comment
Please, Sign In to add comment