From 9f4195b800d451cf73f0e0466f76a5a9786c0183 Mon Sep 17 00:00:00 2001 From: Tim Eertmoed Date: Thu, 13 Aug 2026 23:13:39 +0200 Subject: [PATCH] usr/local/bin/custom/poe.sh aktualisiert --- usr/local/bin/custom/poe.sh | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/usr/local/bin/custom/poe.sh b/usr/local/bin/custom/poe.sh index 5287810..ede9c80 100644 --- a/usr/local/bin/custom/poe.sh +++ b/usr/local/bin/custom/poe.sh @@ -52,24 +52,13 @@ expect { "assword:" { send "$password\r"; exp_continue } "Press any key" { send "\r"; exp_continue } -re ".*> $" { } - timeout { exit 1 } - eof { exit 1 } } send "configure terminal\r" -expect { - "(config)#" { } - timeout { exit 1 } -} +expect "(config)#" send "interface $switch_port\r" -expect { - "(eth-$switch_port)#" { } - timeout { exit 1 } -} +expect "(eth-$switch_port)#" send "no power-over-ethernet\r" -expect { - "(eth-$switch_port)#" { } - timeout { exit 1 } -} +expect "(eth-$switch_port)#" send "exit\r" expect "(config)#" send "exit\r" @@ -78,7 +67,6 @@ send "exit\r" expect ">"; send "exit\r" expect "Do you want to log out (y/n)?" { send "y\r" } expect eof -exit 0 EOF } @@ -95,24 +83,13 @@ expect { "assword:" { send "$password\r"; exp_continue } "Press any key" { send "\r"; exp_continue } -re ".*> $" { } - timeout { exit 1 } - eof { exit 1 } } send "configure terminal\r" -expect { - "(config)#" { } - timeout { exit 1 } -} +expect "(config)#" send "interface $switch_port\r" -expect { - "(eth-$switch_port)#" { } - timeout { exit 1 } -} +expect "(eth-$switch_port)#" send "power-over-ethernet\r" -expect { - "(eth-$switch_port)#" { } - timeout { exit 1 } -} +expect "(eth-$switch_port)#" send "exit\r" expect "(config)#" send "exit\r" @@ -121,7 +98,6 @@ send "exit\r" expect ">"; send "exit\r" expect "Do you want to log out (y/n)?" { send "y\r" } expect eof -exit 0 EOF }