Created
May 27, 2013 21:38
-
-
Save azet/5659213 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| -- Author: Aaron <azet@azet.org> Zauner | |
| -- License: MIT License (http://opensource.org/licenses/mit-license.php) | |
| -- Description: | |
| whatis("Changes PS1 color depending on the host category (e.g. login, compute,..) in the cluster") | |
| family("syscommon") | |
| hostname = os.getenv("HOSTNAME") | |
| if string.match(hostname, "dmn") then | |
| setenv("PS1", "\\e[45m \\e[0m \\[\\e]0;\\u@\\h: \\w\\a\\]\\u@\\e[0;35m\\h\\e[0m [\\w]> ") | |
| elseif string.match(hostname, "login") then | |
| setenv("PS1", "\\e[43m \\e[0m \\[\\e]0;\\u@\\h: \\w\\a\\]\\u@\\e[0;33m\\h\\e[0m [\\w]> ") | |
| elseif string.match(hostname, "sac") then | |
| setenv("PS1", "\\e[41m \\e[0m \\[\\e]0;\\u@\\h: \\w\\a\\]\\u@\e[0;31m\\h\\e[0m [\\w]> ") | |
| else -- assume compute node | |
| setenv("PS1", "\\e[46m \\e[0m \\[\\e]0;\\u@\\h: \\w\\a\\]\\u@\\e[0;36m\\h\\e[0m [\\w]> ") | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment