20 lines
370 B
Text
20 lines
370 B
Text
|
#!/bin/sh
|
||
|
#
|
||
|
# $FreeBSD$
|
||
|
#
|
||
|
|
||
|
JSH="$(echo ${PKG_PREFIX-/usr/local}/bin/jsh | /usr/bin/sed -e 's|//|/|g')"
|
||
|
SHELLS="/etc/shells"
|
||
|
|
||
|
case $2 in
|
||
|
POST-INSTALL)
|
||
|
if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$JSH\$" "$SHELLS"; then
|
||
|
if [ $(id -u) -eq 0 ]; then
|
||
|
echo "$JSH" >> "$SHELLS"
|
||
|
else
|
||
|
echo "Not root, please add $JSH to $SHELLS manually"
|
||
|
fi
|
||
|
fi
|
||
|
;;
|
||
|
esac
|