2014-07-24 19:10:57 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# MAINTAINER: portmgr@FreeBSD.org
|
|
|
|
#
|
|
|
|
# @shell bin/shell
|
|
|
|
#
|
|
|
|
# Handle adding and remove a path to a shell binary into /etc/shells
|
|
|
|
# it replaces the following code:
|
|
|
|
#
|
|
|
|
# bin/shell
|
|
|
|
# @exec echo "Updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak; echo %D/%F) >/etc/shells; rm -f /etc/shells.bak
|
|
|
|
# @unexec echo "Updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak) >/etc/shells; rm -f /etc/shells.bak
|
|
|
|
|
|
|
|
actions: [file]
|
|
|
|
post-install: <<EOD
|
2014-10-08 23:39:47 +02:00
|
|
|
case "%@" in
|
|
|
|
/*) file="%@" ;;
|
|
|
|
*) file="%D/%@" ;;
|
|
|
|
esac
|
2014-07-24 19:10:57 +02:00
|
|
|
cp /etc/shells /etc/shells.bak
|
2015-02-16 22:34:46 +01:00
|
|
|
(grep -v "^${file}$" /etc/shells.bak; echo ${file}) > /etc/shells
|
2014-07-24 19:10:57 +02:00
|
|
|
rm -f /etc/shells.bak
|
|
|
|
EOD
|
|
|
|
pre-deinstall: <<EOD
|
2014-10-08 23:39:47 +02:00
|
|
|
case "%@" in
|
|
|
|
/*) file="%@" ;;
|
|
|
|
*) file="%D/%@" ;;
|
|
|
|
esac
|
2014-07-24 19:10:57 +02:00
|
|
|
cp /etc/shells /etc/shells.bak
|
2015-02-16 22:34:46 +01:00
|
|
|
grep -v "^${file}$" /etc/shells.bak > /etc/shells
|
2014-07-24 19:10:57 +02:00
|
|
|
rm -f /etc/shells.bak
|
|
|
|
EOD
|