|
|
a3ca39 |
commit ddd74b5d971a734c7e88cda3764f7e059f163b51
|
|
|
a3ca39 |
Author: Pavel Zhukov <pzhukov@redhat.com>
|
|
|
a3ca39 |
Date: Wed Jul 14 11:43:39 2021 +0200
|
|
|
a3ca39 |
|
|
|
a3ca39 |
Add fallback to hostname determination
|
|
|
a3ca39 |
|
|
|
a3ca39 |
Use hostname in case if hostnamectl is not available/not functional.
|
|
|
a3ca39 |
fallback to uname in case if both hostname and hostnamectl are
|
|
|
a3ca39 |
missed (in containers)
|
|
|
a3ca39 |
|
|
|
a3ca39 |
diff --git a/profile b/profile
|
|
|
a3ca39 |
index 783fe17..542add4 100644
|
|
|
a3ca39 |
--- a/profile
|
|
|
a3ca39 |
+++ b/profile
|
|
|
a3ca39 |
@@ -42,7 +42,10 @@ else
|
|
|
a3ca39 |
pathmunge /usr/sbin after
|
|
|
a3ca39 |
fi
|
|
|
a3ca39 |
|
|
|
a3ca39 |
-HOSTNAME=`/usr/bin/hostnamectl --transient 2>/dev/null`
|
|
|
a3ca39 |
+HOSTNAME=$(/usr/bin/hostnamectl --transient 2>/dev/null) || \
|
|
|
a3ca39 |
+HOSTNAME=$(/usr/bin/hostname 2>/dev/null) || \
|
|
|
a3ca39 |
+HOSTNAME=$(/usr/bin/uname -n)
|
|
|
a3ca39 |
+
|
|
|
a3ca39 |
HISTSIZE=1000
|
|
|
a3ca39 |
if [ "$HISTCONTROL" = "ignorespace" ] ; then
|
|
|
a3ca39 |
export HISTCONTROL=ignoreboth
|
|
|
a3ca39 |
commit f20b64fc99267d2343aa9141cf709ac1131bc178
|
|
|
a3ca39 |
Author: Pavel Zhukov <pzhukov@redhat.com>
|
|
|
a3ca39 |
Date: Thu Jul 15 10:31:57 2021 +0200
|
|
|
a3ca39 |
|
|
|
a3ca39 |
Do not use hostnamectl in csh
|
|
|
a3ca39 |
|
|
|
a3ca39 |
diff --git a/csh.cshrc b/csh.cshrc
|
|
|
a3ca39 |
index c3a37a3..eda4aa7 100644
|
|
|
a3ca39 |
--- a/csh.cshrc
|
|
|
a3ca39 |
+++ b/csh.cshrc
|
|
|
a3ca39 |
@@ -20,7 +20,7 @@ if ($?prompt) then
|
|
|
a3ca39 |
# make completion work better by default
|
|
|
a3ca39 |
set autolist
|
|
|
a3ca39 |
else
|
|
|
a3ca39 |
- set prompt=\[$user@`/usr/bin/hostnamectl --transient | cut -d'.' -f1`\]\$\
|
|
|
a3ca39 |
+ set prompt=\[$user@`/usr/bin/hostname`\]\$\
|
|
|
a3ca39 |
endif
|
|
|
a3ca39 |
endif
|
|
|
a3ca39 |
|
|
|
a3ca39 |
diff --git a/csh.login b/csh.login
|
|
|
a3ca39 |
index 2da86c9..e4b1990 100644
|
|
|
a3ca39 |
--- a/csh.login
|
|
|
a3ca39 |
+++ b/csh.login
|
|
|
a3ca39 |
@@ -25,7 +25,7 @@ else
|
|
|
a3ca39 |
end
|
|
|
a3ca39 |
endif
|
|
|
a3ca39 |
|
|
|
a3ca39 |
-setenv HOSTNAME `/usr/bin/hostnamectl --transient`
|
|
|
a3ca39 |
+setenv HOSTNAME `/usr/bin/hostname`
|
|
|
a3ca39 |
set history=1000
|
|
|
a3ca39 |
|
|
|
a3ca39 |
if ( -d /etc/profile.d ) then
|