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