Sophie

Sophie

distrib > Mandriva > 10.0 > i586 > by-pkgid > a62f517ae0a318d35838e01d212d98f8 > scriptlet

initscripts-7.06-49mdk.i586.rpm

PREIN

/bin/sh

# usb is called from rc.sysinit now
if [ "$1" -gt 0 ]; then
	/bin/grep -q 'chkconfig:' /etc/init.d/usb 2> /dev/null && /sbin/chkconfig --del usb > /dev/null 2>&1 || :
fi

PREUN

/bin/sh
/usr/share/rpm-helper/del-service initscripts $1 random 

/usr/share/rpm-helper/del-service initscripts $1 netfs 

/usr/share/rpm-helper/del-service initscripts $1 network 

/usr/share/rpm-helper/del-service initscripts $1 rawdevices 

/usr/share/rpm-helper/del-service initscripts $1 dm 

/usr/share/rpm-helper/del-service initscripts $1 sound 

/usr/share/rpm-helper/del-service initscripts $1 partmon 

/usr/share/rpm-helper/del-service initscripts $1 alsa

POSTIN

/bin/sh
##Fixme
touch /etc/sysconfig/i18n
##
touch /var/log/wtmp
touch /var/run/utmp
chown root:utmp /var/log/wtmp /var/run/utmp
chmod 664 /var/log/wtmp /var/run/utmp

if [ $1 = 1 ]; then /sbin/chkconfig --add random; fi;
if [ $1 = 1 ]; then /sbin/chkconfig --add netfs; fi;
if [ $1 = 1 ]; then /sbin/chkconfig --add network; fi;
if [ $1 = 1 ]; then /sbin/chkconfig --add rawdevices; fi;
if [ $1 = 1 ]; then /sbin/chkconfig --add sound; fi;
if [ $1 = 1 ]; then /sbin/chkconfig --add partmon; fi;
if [ $1 = 1 ]; then /sbin/chkconfig --add alsa; fi;
if [ $1 = 1 ]; then /sbin/chkconfig --add dm; fi;
# handle serial installs semi gracefully
if [ $1 = 0 ]; then
  if [ "$TERM" = "vt100" ]; then
      tmpfile=`mktemp /etc/sysconfig/tmp.XXXXXX`
      sed -e '/BOOTUP=color/BOOTUP=serial/' /etc/sysconfig/init > $tmpfile
      mv -f $tmpfile /etc/sysconfig/init
  fi
fi

# dup of timeconfig %post - here to avoid a dependency
if [ -L /etc/localtime ]; then
    _FNAME=`ls -ld /etc/localtime | awk '{ print $11}' | sed 's/lib/share/'`
    rm /etc/localtime
    cp -f $_FNAME /etc/localtime
    if ! grep -q "^ZONE=" /etc/sysconfig/clock ; then
      echo "ZONE=\"$_FNAME"\" | sed -e "s|[^\"]*/usr/share/zoneinfo/||" >> /etc/sysconfig/clock
    fi
fi

# /etc/sysconfig/desktop format has changed
if [ -r /etc/sysconfig/desktop ]; then
    if ! grep -q = /etc/sysconfig/desktop; then
        DESK=`cat /etc/sysconfig/desktop`
        echo "DESKTOP=$DESK" > /etc/sysconfig/desktop
    fi
fi

# handle serial installs semi gracefully
if [ $1 = 0 ]; then
  if [ "$TERM" = "vt100" ]; then
      tmpfile=/etc/sysconfig/tmp.$$
      sed -e '/BOOTUP=color/BOOTUP=serial/' /etc/sysconfig/init > $tmpfile
      mv -f $tmpfile /etc/sysconfig/init
  fi
fi

# dup of timeconfig %post - here to avoid a dependency
if [ -L /etc/localtime ]; then
    _FNAME=`ls -ld /etc/localtime | awk '{ print $11}' | sed 's/lib/share/'`
    rm /etc/localtime
    cp -f $_FNAME /etc/localtime
    if ! grep -q "^ZONE=" /etc/sysconfig/clock ; then
      echo "ZONE=\"$_FNAME"\" | sed -e "s|[^\"]*/usr/share/zoneinfo/||" >> /etc/sysconfig/clock
    fi
fi

# Add right translation file
for i in `echo $LANGUAGE:$LC_ALL:$LC_COLLATE:$LANG:C | tr ':' ' '`
do
	if [ -r /usr/share/locale/$i/LC_MESSAGES/initscripts.mo ]; then
		mkdir -p /etc/locale/$i/LC_MESSAGES/
		cp /usr/share/locale/$i/LC_MESSAGES/initscripts.mo \
			/etc/locale/$i/LC_MESSAGES/
                #
		# warly
		# FIXME: this should be done by each locale when installed or upgraded
		#
		pushd /usr/share/locale/$i/ > /dev/null && for j in LC_*
		do
			if [ -r $j -a ! -d $j ]; then
			    cp $j /etc/locale/$i/
			fi
		done && popd > /dev/null
		if [ -r /usr/share/locale/$i/LC_MESSAGES/SYS_LC_MESSAGES ]; then
			cp /usr/share/locale/$LANG/LC_MESSAGES/SYS_LC_MESSAGES /etc/locale/$i/LC_MESSAGES/
		fi
		#
		#
		break
	fi
done



# only needed on upgrade
if [ $1 != 0 ]; then
	# handle the switch to an independant prefdm initscript
	if grep -q '^x:5' /etc/inittab; then
		rm -f /etc/inittab.new
		sed 's/x:5/#x:5/' < /etc/inittab > /etc/inittab.new
		mv -f /etc/inittab.new /etc/inittab
		chkconfig --add dm || :
	fi

	# Handle boot sequence changes on upgrade
	if [[ -f /etc/rc3.d/S80partmon ]] && [[ -f /etc/rc5.d/S80partmon ]] && egrep -q 'chkconfig: [0-9]+ 13' /etc/init.d/partmon; then chkconfig --add partmon || : ; fi;	
	if [[ -f /etc/rc3.d/S71sound ]] && [[ -f /etc/rc5.d/S71sound ]] && egrep -q 'chkconfig: [0-9]+ 18' /etc/init.d/sound; then chkconfig --add sound || : ; fi;	
	if [[ -f /etc/rc3.d/S70alsa ]] && [[ -f /etc/rc5.d/S70alsa ]] && egrep -q 'chkconfig: [0-9]+ 17' /etc/init.d/alsa; then chkconfig --add alsa || : ; fi;	
fi

POSTUN

/bin/sh
if [ -f /var/lock/TMP_1ST ];then 
		rm -f /var/lock/TMP_1ST
fi
if [ "$1" = "0" ]; then
	for i in /etc/locale/*/LC_MESSAGES/initscripts.mo
	do
		rm -f $i
		rmdir `dirname $i` >/dev/null 2> /dev/null
	done
	rmdir /etc/locale/* >/dev/null 2> /dev/null
fi

Triggers

initscripts <= 4.72

/bin/sh
. /etc/sysconfig/init
. /etc/sysconfig/network

# These are the non-default settings. By putting them at the end
# of the /etc/sysctl.conf file, it will override the default
# settings earlier in the file.

if [ -n "$FORWARD_IPV4" -a "$FORWARD_IPV4" != "no" -a "$FORWARD_IPV4" != "false" ]; then
	echo "# added by initscripts install on `date`" >> /etc/sysctl.conf
	echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
fi

newnet=`mktemp /etc/sysconfig/network.XXXXXX`
if [ -n "$newnet" ]; then
  sed "s|FORWARD_IPV4.*|# FORWARD_IPV4 removed; see /etc/sysctl.conf|g" \
   /etc/sysconfig/network > $newnet
  sed "s|DEFRAG_IPV4.*|# DEFRAG_IPV4 removed; obsolete in 2.4. kernel|g" \
   $newnet > /etc/sysconfig/network
  rm -f $newnet
fi

if [ -n "$MAGIC_SYSRQ" -a "$MAGIC_SYSRQ" != "no" ]; then
	echo "# added by initscripts install on `date`" >> /etc/sysctl.conf
	echo "kernel.sysrq = 1" >> /etc/sysctl.conf
fi
if uname -m | grep -q sparc ; then
   if [ -n "$STOP_A" -a "$STOP_A" != "no" ]; then
	echo "# added by initscripts install on `date`" >> /etc/sysctl.conf
	echo "kernel.stop-a = 1" >> /etc/sysctl.conf
   fi
fi