Hallo
Versuche ein Script zu erstellen das mir das Synology Nas auschalten soll.
1 2 3 4 5 6 7 8 9 10 | #!/usr/bin/expect spawn telnet 192.168.178.60 expect "login:" send "root\n" expect "Password:" send ".......\n" expect "Nas4>" send "poweroff\n" send "exit\n" exit |
Erhalte das.
Nas4> damu@ubuntu-damu:~$ damu@ubuntu-damu:~$ test.sh spawn telnet 192.168.178.60 Trying 192.168.178.60... Connected to 192.168.178.60. Escape character is '^]'. Nas4 login: root Password: BusyBox v1.16.1 (2015-11-12 17:58:02 CST) built-in shell (ash) Enter 'help' for a list of built-in commands. Nas4> damu@ubuntu-damu:~$
Irgendwie klappt es mit der Übergabe des Passwords nicht. Ausschalten geht natürlich über die Konsole mit Telnet.