-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added function to get tempereatures from UDM-pro machine w ssh and sensors -u command
- Loading branch information
Showing
6 changed files
with
105 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
28 changes: 28 additions & 0 deletions
28
uniFiAP.indigoPlugin/Contents/Server Plugin/UDM-pro-sensors.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
set userID [lindex $argv 0 ] | ||
set password [lindex $argv 1 ] | ||
set ipNumber [lindex $argv 2 ] | ||
set promptOnServer [lindex $argv 3] | ||
|
||
set timeout 20 | ||
spawn ssh $userID@$ipNumber | ||
expect { | ||
"(yes/no" { | ||
send "yes\n" | ||
sleep 0.1 | ||
expect "assword" { send "$password\n"} | ||
} | ||
"assword: " { | ||
send "$password\n" | ||
} | ||
} | ||
|
||
set timeout 3 | ||
expect "Permission denied" {send \003\r"; exit 1} | ||
|
||
expect "$promptOnServer"{ | ||
send sensors -u\n | ||
} | ||
expect "$promptOnServer" | ||
send "exit\r" | ||
sleep 0.1 | ||
expect eof |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters