Created
October 27, 2016 16:28
-
-
Save adosztal/ab57ce222e0b9a5b2b5e4b009927fa2e to your computer and use it in GitHub Desktop.
Add availability to GNS3 appliance files
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 | |
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