Skip to content

Commit

Permalink
kiss-vm,*: avoid hostname -A return fail
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhong Yin <[email protected]>
  • Loading branch information
tcler committed Mar 29, 2024
1 parent d10571b commit 754238c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kiss-vm
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ vmvncproc() {
local port=$(_vmvncport $_vmname)
if [[ -n "${port}" ]]; then
if [[ -z "${VNCPUTS}" && -z "${VNCGET}" && -z "${VNCGETSC}" ]]; then
hnames=$(hostname -A); test -z "$hnames" && hnames=$(hostname)
hnames=$(hostname -A 2>/dev/null); test -z "$hnames" && hnames=$(hostname)
h=0
for _host in $(echo "${hnames}"|xargs -n 1|sort -u); do
_host=${_host%.localdomain}
Expand Down
2 changes: 1 addition & 1 deletion utils/answer-file-generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ IPCONFIG_LOGF=ipconfig.log
INSTALL_COMPLETE_FILE=installcomplete
POST_INSTALL_LOGF=postinstall.log
VIRTHOST=$(
for H in $(hostname -A); do
for H in $(hostname -A 2>/dev/null || hostname); do
if [[ ${#H} > 15 && $H = *.*.* ]]; then
echo $H;
break;
Expand Down

0 comments on commit 754238c

Please sign in to comment.