From fd88f665417ca0c6c655f19d57da35df3ad45984 Mon Sep 17 00:00:00 2001 From: KenwoodFox Date: Tue, 17 Aug 2021 19:10:20 -0400 Subject: [PATCH] Push bash script --- scripts/hpe_switch.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/hpe_switch.sh diff --git a/scripts/hpe_switch.sh b/scripts/hpe_switch.sh new file mode 100755 index 0000000..8556494 --- /dev/null +++ b/scripts/hpe_switch.sh @@ -0,0 +1,11 @@ +# Written by joe +# Usage: +# ./hpe_switch.sh + +if [ $2 = "on" ]; then + state="" +else + state="no" +fi + +{ sleep 1; echo -e ""; sleep 1; echo -e "5"; sleep 1; echo -e "config"; sleep 1; echo -e "$state interface $1 power"; sleep 1; echo -e "write memory"; sleep 1; echo -e "exit"; sleep 1; echo -e "exit"; sleep 1; echo -e "y"; } | telnet 10.85.3.96