* usr/bin/byobu-select-profile:

- find a suitable hash sum utility (fixes Mac OS X)
This commit is contained in:
Dustin Kirkland 2013-01-27 22:27:47 -06:00
commit 2bc356990f
2 changed files with 13 additions and 3 deletions

2
debian/changelog vendored
View file

@ -13,6 +13,8 @@ byobu (5.30) unreleased; urgency=low
- fix lintian info messages
* NEWS:
- point to byobu.co in NEWS file
* usr/bin/byobu-select-profile:
- find a suitable hash sum utility (fixes Mac OS X)
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 19 Jan 2013 14:18:01 -0600

View file

@ -49,6 +49,14 @@ COLORS="default_light \
yellow \
brown"
# Find a hash utility
for i in md5sum md5 sha512sum sha256sum sha1sum shasum shasum5.12 shasum5.10; do
if $BYOBU_TEST $i >/dev/null 2>&1; then
HASH="$i"
break
fi
done
usage () {
cat <<EOT
Usage: $0 [(-l|--list)][(-h|--help)]
@ -225,7 +233,7 @@ else
break
;;
-h|--hostname)
color=$(hostname | md5sum | head -c 6)
color=$(hostname | $HASH | head -c 6)
setcolor_tmux "$color"
shift
break
@ -233,13 +241,13 @@ else
-i|--ip)
[ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc"
. $BYOBU_PREFIX/lib/$PKG/ip_address
color=$(__ip_address t| md5sum | head -c 6)
color=$(__ip_address t| $HASH | head -c 6)
setcolor_tmux "$color"
shift
break
;;
-r|--random)
color=$(head -c 10 /dev/urandom | md5sum | head -c 6)
color=$(head -c 10 /dev/urandom | $HASH | head -c 6)
setcolor_tmux "$color"
shift
break