Skip to content

Instantly share code, notes, and snippets.

@adosztal
Created October 27, 2016 16:28
Show Gist options
  • Save adosztal/ab57ce222e0b9a5b2b5e4b009927fa2e to your computer and use it in GitHub Desktop.
Save adosztal/ab57ce222e0b9a5b2b5e4b009927fa2e to your computer and use it in GitHub Desktop.
Add availability to GNS3 appliance files
#!/bin/bash
echo "Availability:"
echo "1 - free"
echo "2 - with-registration"
echo "3 - free-to-try"
echo "4 - service-contract"
echo
echo
for FILE in `ls *gns3a`
do
echo -en "\033[1A\033[2K${FILE}: "
read CHOICE
case $CHOICE in
1)
AVAILABILITY="free";;
2)
AVAILABILITY="with-registration";;
3)
AVAILABILITY="free-to-try";;
4)
AVAILABILITY="service-contract";;
esac
sed -i "s/ \"maintainer\"/ \"availability\": \"${AVAILABILITY}\",\n \"maintainer\"/" $FILE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment