Last active
June 26, 2018 14:14
-
-
Save koesper/28400bf0cd7b44c2b169ef27e0e06369 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
#!/usr/bin/env bash | |
letsencrypt () { | |
echo "Creating certificates for: " $SPACE_FULL | |
BACKUP_DIR="$SPACE $(date '+%Y-%m-%d %H:%M:%S')" | |
mkdir "$BACKUP_DIR" | |
cp $SPACE.json "$BACKUP_DIR" | |
bx target -o "####MYCOMPANYACCOUNTNAMEHERE####" -s "$SPACE_FULL" | |
cp $SPACE.json bluemix-letsencrypt/domains.json | |
cd bluemix-letsencrypt | |
python3 setup-app.py | |
cd .. | |
mv bluemix-letsencrypt/*.pem "$BACKUP_DIR" | |
} | |
menu () { | |
echo "Lets generate some certificates!" | |
echo "" | |
echo "For which space do you want to create the domains?" | |
echo "--------------------------" | |
echo "Press 1 for Space1" | |
echo "Press 2 for Space2" | |
echo "Press 3 for Space with difficult name" | |
echo "" | |
echo "Press x to exit the script" | |
echo "--------------------------" | |
# read -p "Input Selection:" SPACE_NR; | |
echo "For which space do you want to create the domains?" | |
sleep 0.1 | |
select SPACE in "space1" "space2" "space3" "quit"; do | |
case $SPACE in | |
"space1") | |
SPACE_FULL=$SPACE | |
letsencrypt; | |
break; | |
;; | |
"space2") | |
SPACE_FULL=$SPACE | |
letsencrypt; | |
break; | |
;; | |
"space3") | |
SPACE_FULL="Space with difficult name" #DIFFERENT FROM THE SHORT NAME! | |
letsencrypt; | |
break; | |
;; | |
"quit") | |
echo "Bye!" | |
exit; | |
;; | |
*) | |
echo "Not a clue what you want... I'm giving up" | |
exit; | |
;; | |
esac | |
done | |
} | |
menu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
created for ibmjstart/bluemix-letsencrypt#16 (comment)