Skip to content

Instantly share code, notes, and snippets.

@nohtyp
Created October 23, 2014 18:46
Show Gist options
  • Select an option

  • Save nohtyp/91bbc4f8b898d54d6b30 to your computer and use it in GitHub Desktop.

Select an option

Save nohtyp/91bbc4f8b898d54d6b30 to your computer and use it in GitHub Desktop.
This script goes to choice.py script that deals with remote management(I use puppet now..:-) )
#!/bin/bash
case $0 in
*create)
answer="chage -l $1;$?"
if [ "$answer | awk -F';' '{ print $2 }' == 0" ]; then
#echo "The command was sent to $HOSTNAME successfully!"
echo "The command was sent to $HOSTNAME successfully!"
chage -l $1
else
echo "The command failed to send to $HOSTNAME!"
fi;;
*delete) answer="removeme -r $1" ;;
esac
#echo $answer | awk -F';' '{print $1}'> thomas.test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment