Last active
November 19, 2015 18:03
-
-
Save loisaidasam/d4cd1bc55a0c62ca6554 to your computer and use it in GitHub Desktop.
Custom $PS1 for ElasticBeanstalk boxes - http://blog.samsandberg.com/2015/11/17/the-little-things-custom-ps1-for-elasticbeanstalk-boxes/
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
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/997_setup_ps1.sh": | |
mode: "000755" | |
owner: ec2-user | |
group: ec2-user | |
content: | | |
#!/usr/bin/env bash | |
# Custom bash prompt via kirsle.net/wizards/ps1.html ("Pink and Blue" theme) | |
echo "Setting up PS1 ..." | |
if cat /home/ec2-user/.bashrc | grep -q "PS1" | |
then | |
echo "Already set up PS1" | |
else | |
echo "" >> /home/ec2-user/.bashrc | |
echo 'export PS1="\[$(tput bold)\]\[$(tput setaf 4)\][\[$(tput setaf 5)\]\u\[$(tput setaf 4)\]@\[$(tput setaf 5)\]\h \[$(tput setaf 2)\]\W\[$(tput setaf 4)\]]\\$ \[$(tput sgr0)\]"' >> /home/ec2-user/.bashrc | |
echo "Set up!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment