Sophie

Sophie

distrib > Mandriva > 7.1 > i586 > by-pkgid > 43f825a5446c38ac9029476c6194ddbc > scriptlet

roxen-1.3.122-4mdk.i586.rpm

PREUN

/bin/sh
if [ $1 -eq 0 ]; then	# We're running "rpm -e"
	if [ -x /etc/rc.d/init.d/roxen ]; then
		/etc/rc.d/init.d/roxen stop;
		chkconfig --del roxen;
	fi
	rm -f /etc/rc.d/init.d/roxen;
	rm -rf /var/log/roxen/*;
	rm -rf /etc/roxen;
fi

POSTIN

/bin/sh
if [ $1 -eq 1 ]; then	# We're running "rpm -i"
	# Short hint for Admin
	echo "Use https://"`hostname`":13122/ for the administration-interface" > \
		/usr/doc/roxen-1.3.122/readme.txt
	echo "Use http://"`hostname`"/doc/ for manuales" >> \
		/usr/doc/roxen-1.3.122/readme.txt
	echo "Or use the PDF-documents within /usr/doc/roxen-1.3.122/" >> \
		/usr/doc/roxen-1.3.122/readme.txt

    # Install welcome-HTML-page
    cat /etc/roxen/index.html.template \
        | sed -e "s/%HOST%/`hostname`/g" \
        > /home/roxen/html/index.html

	# Install a basic configuration
	cat /etc/roxen/configurations/Global_Variables.template \
		| sed -e "s/%HOST%/`hostname`/g" \
		> /etc/roxen/configurations/Global_Variables
	chmod u=rw,g=r,o= \
		/etc/roxen/configurations/Global_Variables

	cat /etc/roxen/configurations/Host.template \
		| sed -e "s/%HOST%/`hostname`/g" \
		> /etc/roxen/configurations/`hostname`
	chmod u=rw,g=r,o= \
		/etc/roxen/configurations/`hostname`

    # Delete templates
	rm -f /etc/roxen/configurations/*.template

    # Add Roxen in according Runlevels
	chkconfig --add roxen

elif [ $1 -gt 1 ]; then	# We're running "rpm -U"
	/etc/rc.d/init.d/roxen status 2>&1 > /dev/null
	if [ $? -eq 0]; then
		/etc/rc.d/init.d/roxen restart
	fi
fi