Skip to content

Instantly share code, notes, and snippets.

@fjrti
Created October 28, 2021 19:50
Show Gist options
  • Save fjrti/3e1a1206264226260690aa76ed580ed8 to your computer and use it in GitHub Desktop.
Save fjrti/3e1a1206264226260690aa76ed580ed8 to your computer and use it in GitHub Desktop.
#!/bin/bash
#==============================================
# Author: Ricky.K
# Description: Auto telnet and run command
#==============================================
echo "My own command..." &&
(sleep 1; echo "user"; \
sleep 1; echo "password"; \
sleep 1; echo "cd /usr/local"; \
sleep 1; echo "./test.sh"; \
while [[ true ]]; do \
sleep 1; \
done;) | telnet 192.168.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment