You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
623 B

  1. --- a/usr/lib/byobu/hostname
  2. +++ b/usr/lib/byobu/hostname
  3. @@ -20,12 +20,16 @@
  4. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  5. __hostname_detail() {
  6. - hostname -f
  7. + hostname -f 2>/dev/null
  8. }
  9. __hostname() {
  10. local h=
  11. - h=$(hostname -s 2>/dev/null || hostname)
  12. + if eval $BYOBU_TEST hostname >/dev/null 2>&1; then
  13. + h=$(hostname -s 2>/dev/null || hostname)
  14. + elif [ -r /proc/sys/kernel/hostname ]; then
  15. + read h < /proc/sys/kernel/hostname
  16. + fi
  17. if metadata_available; then
  18. local cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/hostname"
  19. # Background a retrieval of our public hostname