Last active
December 25, 2015 00:58
-
-
Save ohadlevy/6891157 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ID=$1 | |
EDITOR='vim' | |
if [ -z "$ID" ]; then | |
echo "Must define ID, listing templates instead" | |
hammer template list | |
echo "please execute $0 <ID>" | |
exit 1 | |
fi | |
TFILE="/tmp/foreman-$(basename $0).$$.eruby" | |
hammer template dump --id $ID > $TFILE | |
$EDITOR $TFILE | |
echo "if you want to upload your changes then execute:" | |
echo "hammer template update --file $TFILE --id $ID --audit-comment <change info>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmmmm why dont we edit that right away - hammer could open up the $EDITOR...