usr/local/bin/custom/poe.sh aktualisiert

This commit is contained in:
2026-08-13 23:13:39 +02:00
parent d066dbf03d
commit 9f4195b800
+6 -30
View File
@@ -52,24 +52,13 @@ expect {
"assword:" { send "$password\r"; exp_continue } "assword:" { send "$password\r"; exp_continue }
"Press any key" { send "\r"; exp_continue } "Press any key" { send "\r"; exp_continue }
-re ".*> $" { } -re ".*> $" { }
timeout { exit 1 }
eof { exit 1 }
} }
send "configure terminal\r" send "configure terminal\r"
expect { expect "(config)#"
"(config)#" { }
timeout { exit 1 }
}
send "interface $switch_port\r" send "interface $switch_port\r"
expect { expect "(eth-$switch_port)#"
"(eth-$switch_port)#" { }
timeout { exit 1 }
}
send "no power-over-ethernet\r" send "no power-over-ethernet\r"
expect { expect "(eth-$switch_port)#"
"(eth-$switch_port)#" { }
timeout { exit 1 }
}
send "exit\r" send "exit\r"
expect "(config)#" expect "(config)#"
send "exit\r" send "exit\r"
@@ -78,7 +67,6 @@ send "exit\r"
expect ">"; send "exit\r" expect ">"; send "exit\r"
expect "Do you want to log out (y/n)?" { send "y\r" } expect "Do you want to log out (y/n)?" { send "y\r" }
expect eof expect eof
exit 0
EOF EOF
} }
@@ -95,24 +83,13 @@ expect {
"assword:" { send "$password\r"; exp_continue } "assword:" { send "$password\r"; exp_continue }
"Press any key" { send "\r"; exp_continue } "Press any key" { send "\r"; exp_continue }
-re ".*> $" { } -re ".*> $" { }
timeout { exit 1 }
eof { exit 1 }
} }
send "configure terminal\r" send "configure terminal\r"
expect { expect "(config)#"
"(config)#" { }
timeout { exit 1 }
}
send "interface $switch_port\r" send "interface $switch_port\r"
expect { expect "(eth-$switch_port)#"
"(eth-$switch_port)#" { }
timeout { exit 1 }
}
send "power-over-ethernet\r" send "power-over-ethernet\r"
expect { expect "(eth-$switch_port)#"
"(eth-$switch_port)#" { }
timeout { exit 1 }
}
send "exit\r" send "exit\r"
expect "(config)#" expect "(config)#"
send "exit\r" send "exit\r"
@@ -121,7 +98,6 @@ send "exit\r"
expect ">"; send "exit\r" expect ">"; send "exit\r"
expect "Do you want to log out (y/n)?" { send "y\r" } expect "Do you want to log out (y/n)?" { send "y\r" }
expect eof expect eof
exit 0
EOF EOF
} }