summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-03-01 13:56:06 -0600
committerJesse Luehrs <doy@tozt.net>2012-03-01 18:07:31 -0600
commit6009ba2628c001f7f8ea4edd3defe22681dbabdf (patch)
tree9d81b35bbf1e267580367d1564b8745fa229537c /bin
parent91898743ad3449f625cf1baa7742ed2fb97ded54 (diff)
downloadconf-6009ba2628c001f7f8ea4edd3defe22681dbabdf.tar.gz
conf-6009ba2628c001f7f8ea4edd3defe22681dbabdf.zip
make prompt not fail if we're on an unknown machine
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fancy-prompt3
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;