Skip to content

Instantly share code, notes, and snippets.

@danyanya
Created July 29, 2022 15:34
Show Gist options
  • Save danyanya/4f9fca3c348dd18f7cdd21421d635ad5 to your computer and use it in GitHub Desktop.
Save danyanya/4f9fca3c348dd18f7cdd21421d635ad5 to your computer and use it in GitHub Desktop.
magic ssh restarter script
ADDR=$1
USER=$2
PASS=$3
KEYS='-q -o ServerAliveInterval=2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
SSHPASS="sshpass -p $PASS ssh $KEYS $USER@$ADDR"
$SSHPASS cpeagent restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment