Sophie

Sophie

distrib > Mandriva > cs4.0 > x86_64 > by-pkgid > 130ef1117908088aafa6dbb229ced3ff > scriptlet

ash-0.3.8-8mdk.x86_64.rpm

PREUN

/bin/ash
# Remove /etc/shells entry without using external commands
if [ "$1" = "0" ]; then
	SHELLS=/etc/shells
	TEMP=${SHELLS}-
	for sh in /bin/ash /bin/bsh; do
		while read i; do echo $i; done < $SHELLS > $TEMP
		while read i; do
			[ "$i" = "$sh" ] || echo $i
		done < $TEMP > $SHELLS
	done
fi

POSTIN

/bin/ash
# Add /etc/shells entry without using external commands
SHELLS=/etc/shells
for sh in /bin/ash /bin/bsh; do
	while read i; do [ "$i" = "$sh" ] && break; done < $SHELLS
	[ "$i" = "$sh" ] || echo $sh >> $SHELLS
done