maj ulib/redhat

This commit is contained in:
Jephté Clain 2021-04-06 11:59:51 +04:00
parent 40c9cb968c
commit dfb5fc31d8
1 changed files with 19 additions and 0 deletions

View File

@ -91,3 +91,22 @@ function network_fix_hostname() {
fi fi
[ -n "$modified" ] [ -n "$modified" ]
} }
function network_fix_mailname() {
local host="$1"
local modified
[ -f /etc/mailname ] || touch /etc/mailname
if [ -n "$__REDHAT_NETWORK_DEVEL_SHOW_MODIFS" -o -n "$__NETWORK_DEVEL_SHOW_MODIFS" ]; then
uecho "Setting /etc/mailname to $host"
elif [ "$(</etc/mailname)" != "$host" ]; then
__network_backup /etc/mailname
if show_debug; then
edebug "Setting /etc/mailname to $host"
else
estep /etc/mailname
fi
echo "$host" >/etc/mailname
modified=1
fi
[ -n "$modified" ]
}