Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #INPUT DATA HERE
- USER='khan'
- PASSWORD='1'
- IPADDRESS='192.168.106.194'
- PORT='22'
- #Connect
- CONNNECT() {
- sshpass -p$PASSWORD ssh -p$PORT $USER@$IPADDRESS "$1"
- }
- #socket and run command from here
- socket() {
- if [[ -z "$1" ]]; then
- echo "parameter $1 is empty"
- exit
- else CONNNECT $1
- fi
- }
- #delet this if this file socket become source !
- case $1 in
- $1 ) socket $1
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment