This commit is contained in:
parent
a82c2ecff8
commit
f2f3223eeb
14
netcfg.spec
14
netcfg.spec
@ -79,11 +79,9 @@ ln -s %{_sysconfdir}/hostname %{buildroot}%{_sysconfdir}/HOSTNAME
|
||||
# REMOVE after SLE11/openSUSE-13.1 out of MIGRATION support
|
||||
if [ $1 -gt 1 ]; then
|
||||
if [ -f %{_sysconfdir}/HOSTNAME -a ! -L %{_sysconfdir}/HOSTNAME ]; then
|
||||
tempfile=`mktemp`
|
||||
cat %{_sysconfdir}/HOSTNAME > $tempfile
|
||||
cat %{_sysconfdir}/HOSTNAME > %{_sysconfdir}/hostname.rpmsave
|
||||
rm -rf %{_sysconfdir}/HOSTNAME %{_sysconfdir}/hostname
|
||||
cat $tempfile > %{_sysconfdir}/hostname
|
||||
rm -rf $tempfile
|
||||
touch %{_sysconfdir}/hostname
|
||||
ln -s %{_sysconfdir}/hostname %{_sysconfdir}/HOSTNAME
|
||||
fi
|
||||
fi
|
||||
@ -92,8 +90,12 @@ exit 0
|
||||
%post
|
||||
# If the defaultdomain changed just prune it, user is not interested in
|
||||
# 0 size file anyway
|
||||
if [ -f etc/defaultdomain.rpmnew ]; then
|
||||
rm -f etc/defaultdomain.rpmnew
|
||||
if [ -f %{_sysconfdir}/defaultdomain.rpmnew ]; then
|
||||
rm -f %{_sysconfdir}/defaultdomain.rpmnew
|
||||
fi
|
||||
if [ -f %{_sysconfdir}/hostname.rpmsave ]; then
|
||||
cat %{_sysconfdir}/hostname.rpmsave > %{_sysconfdir}/hostname
|
||||
rm -rf %{_sysconfdir}/HOSTNAME.rpmsave %{_sysconfdir}/hostname.rpmsave
|
||||
fi
|
||||
exit 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user