#!/bin/sh # rc.postinstall This file is executed by rc.local when the system is first # initialized after install. It must be executed only once. # # Version: 4.0 Sunday , 12/2015 # # Author: Jean-Philippe Guillemin, # perform post-install config # Improve lilo.conf ( if [ ! -d /sys/firmware/efi ]; then if [ ! "$(grep "resume=" /etc/lilo.conf)" ] ; then swapdevice="$(grep 'swap' /etc/fstab | cut -d " " -f 1 | head -n1)" sed -i "s|^[\# \t]*append[ \t]*=[ \t]*\"\([^\"]*\)\"|append=\"\1 resume=$swapdevice \"|g" /etc/lilo.conf fi if [ ! "$(grep "loglevel" /etc/lilo.conf)" ] ; then sed -i "s|^[\# \t]*append[ \t]*=[ \t]*\"\([^\"]*\)\"|append=\"\1 loglevel=1 \"|g" /etc/lilo.conf fi if [ ! "$(grep "timeout=\"30\"" /etc/lilo.conf)" ] ; then sed -i 's/^[\# \t]*timeout[ \t]*=.*/timeout=\"30\"/g' /etc/lilo.conf fi if [ ! "$(grep "zen.bmp" /etc/lilo.conf)" ] ; then sed -i 's/^[\# \t]*bitmap[ \t]*=.*/ bitmap = \/boot\/zen.bmp/g' /etc/lilo.conf fi /sbin/lilo fi ) 1>/dev/null 2>/dev/null # Improve rc.M ( if [ ! "$(grep "Zenwalk" /etc/rc.d/rc.M)" ] ; then for cmd in rc.samba rc.gpm rc.openldap rc.syslog rc.pulseaudio rc.hald rc.httpd rc.mysqld rc.ntpd rc.autofs rc.sendmail rc.atalk rc.cups rc.lprng rc.saslauthd rc.snmpd rc.dnsmasq rc.pcmcia ; do sed -i 's|\(.*'"$cmd"'.*start\)[ \t]*$|\1 \&|g' /etc/rc.d/rc.M done for cmd in rc.inet2 rc.scanluns rc.sysvinit ; do sed -i 's|\(.*'"$cmd"'\)[ \t]*$|\1 \&|g' /etc/rc.d/rc.M done echo "# Zenwalk mod" >> /etc/rc.d/rc.M fi ) 1>/dev/null 2>/dev/null # cleaning ( rm -f /usr/share/applications/qv4l2.desktop rm -f /usr/share/applications/uxterm.desktop rm -f /usr/share/applications/xterm.desktop chmod 750 /root ) 1>/dev/null 2>/dev/null # End of postinstall stage