aboutsummaryrefslogtreecommitdiff
path: root/shells/psh/files/pkg-install.in
diff options
context:
space:
mode:
Diffstat (limited to 'shells/psh/files/pkg-install.in')
-rw-r--r--shells/psh/files/pkg-install.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/shells/psh/files/pkg-install.in b/shells/psh/files/pkg-install.in
new file mode 100644
index 000000000000..b14f461248b8
--- /dev/null
+++ b/shells/psh/files/pkg-install.in
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PSH="%%PREFIX%%/bin/psh"
+SHELLS="/etc/shells"
+
+case $2 in
+POST-INSTALL)
+ if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$PSH\$" "$SHELLS"; then
+ if [ `id -u` -eq 0 ]; then
+ echo "$PSH" >> "$SHELLS"
+ else
+ echo "Not root, please add $PSH to $SHELLS manually"
+ fi
+ fi
+ ;;
+esac