1f5d8f463c
The MirOS Korn Shell, which contains many additions to the original Korn shell. WWW: http://mirbsd.de/mksh PR: ports/100713 Submitted by: Andreas Kohn <andreas at syndrom23.de>
22 lines
437 B
Bash
22 lines
437 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
MKSH="${PKG_PREFIX-/usr/local}/bin/mksh"
|
|
SHELLS="${PKG_DESTDIR-}/etc/shells"
|
|
|
|
case $2 in
|
|
DEINSTALL)
|
|
if grep -qs "^$MKSH\$" "$SHELLS"; then
|
|
if [ `id -u` -eq 0 ]; then
|
|
TMPSHELLS=`mktemp -t shells`
|
|
grep -v "^$MKSH\$" "$SHELLS" > "$TMPSHELLS"
|
|
cat "$TMPSHELLS" > "$SHELLS"
|
|
rm "$TMPSHELLS"
|
|
else
|
|
echo "Not root, please remove $MKSH from $SHELLS manually"
|
|
fi
|
|
fi
|
|
;;
|
|
esac
|