mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-22 04:17:44 +00:00
ceabe272a7
If one need to write portable shell scripts, this one is excellent for testing them. It is installed as jsh (job shell). Other OpenSolaris user land tools are available in sysutils/heirloom WWW: http://heirloom.sourceforge.net/sh.html PR: ports/122192 Submitted by: Danijel Tasov <danielt at pilgerer.org>
23 lines
471 B
Bash
23 lines
471 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
JSH="$(echo ${PKG_PREFIX-/usr/local}/bin/jsh | /usr/bin/sed -e 's|//|/|g')"
|
|
SHELLS="${PKG_DESTDIR-}/etc/shells"
|
|
|
|
case $2 in
|
|
DEINSTALL)
|
|
if grep -qs "^$JSH\$" "$SHELLS"; then
|
|
if [ $(id -u) -eq 0 ]; then
|
|
TMPSHELLS=$(mktemp -t shells)
|
|
grep -v "^$JSH\$" "$SHELLS" > "$TMPSHELLS"
|
|
cat "$TMPSHELLS" > "$SHELLS"
|
|
rm "$TMPSHELLS"
|
|
else
|
|
echo "Not root, please remove $JSH from $SHELLS manually"
|
|
fi
|
|
fi
|
|
;;
|
|
esac
|