diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-03-01 13:56:06 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-03-01 18:07:31 -0600 |
commit | 6009ba2628c001f7f8ea4edd3defe22681dbabdf (patch) | |
tree | 9d81b35bbf1e267580367d1564b8745fa229537c /bin | |
parent | 91898743ad3449f625cf1baa7742ed2fb97ded54 (diff) | |
download | conf-6009ba2628c001f7f8ea4edd3defe22681dbabdf.tar.gz conf-6009ba2628c001f7f8ea4edd3defe22681dbabdf.zip |
make prompt not fail if we're on an unknown machine
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fancy-prompt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/fancy-prompt b/bin/fancy-prompt index 8c1aece..d06403f 100755 --- a/bin/fancy-prompt +++ b/bin/fancy-prompt @@ -69,6 +69,7 @@ my %colornames = ( tozt => 'yellow', xtahua => 'lightmagenta', zaon => 'lightgreen', + unknown_host => 'brown', error => 'red', @@ -89,7 +90,7 @@ my %colornames = ( background => 'darkgrey', reset => 'reset', ); -$colornames{hostname} = $colornames{$hostname}; +$colornames{hostname} = $colornames{$hostname} || $colornames{unknown_host}; $colornames{user} = $colornames{root} if $root; $colornames{path} = $colornames{ropath} unless -w $pwd; $colornames{error} = $colornames{background} unless $err; |