#!/bin/sh -e
# s/390 has this weird system where you telnet in to run base-config. Now
# that that's done, clean up after the root telnet hacks the s390 installer
# put in place.
if [ "$1" = new ]; then
	machine=`uname -m`
	if [ $machine = s390 ]; then
		# Reenable security for s390 now that installation has
		# been finished. Drop base-config call from /root/.profile
		sed -e 's/#password   required   pam_unix.so nullok obscure min=4 max=8/password   required   pam_unix.so nullok obscure min=4 max=8/' </etc/pam.d/passwd >/etc/pam.d/passwd.tmp
		mv -f /etc/pam.d/passwd.tmp /etc/pam.d/passwd
		sed -e '/pts\//d' </etc/securetty >/etc/securetty.tmp
		mv -f /etc/securetty.tmp /etc/securetty
		sed -e '/\/usr\/sbin\/base-config/d' </root/.profile >/root/.profile.tmp
		mv -f /root/.profile.tmp /root/.profile
	fi
fi
