# And symlink what we found to the new-style default.target
ln -s "$target" %{_sysconfdir}/systemd/system/default.target || :
- # Setup hostname
- HOSTNAME=
- [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
- if [ -n "$HOSTNAME" -a "$HOSTNAME" != "pldmachine" ]; then
- [ -f /etc/hostname ] && mv -f /etc/hostname /etc/hostname.rpmsave
- echo $HOSTNAME > /etc/hostname
- chmod 644 /etc/hostname
+ # Setup hostname if not yet done so
+ if [ ! -f /etc/hostname ] || [ ! -s /etc/hostname ]; then
+ HOSTNAME=
+ [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
+ if [ -n "$HOSTNAME" -a "$HOSTNAME" != "pldmachine" ]; then
+ echo $HOSTNAME > /etc/hostname
+ chmod 644 /etc/hostname
+ fi
fi
# Enable the services we install by default.