diff --git a/pkg.info b/pkg.info index b0ed295..e57231a 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,7 @@ name: fish description: A smart and user-friendly command line shell version: 4.6.0 -revision: 1 +revision: 2 url: https://fishshell.com/ license: GPL2,PSF2,MIT,LGPL2 maintainers: diff --git a/post_install.sh b/post_install.sh index 5882cc0..a7cdeac 100644 --- a/post_install.sh +++ b/post_install.sh @@ -1,7 +1,10 @@ -#!/bin/bash +#!/bin/sh -SHELL="/bin/fish" +SHELLS="/bin/fish /usr/bin/fish" -if ! grep "${SHELL}" "$BPM_ROOT"/etc/shells; then - echo "${SHELL}" | tee -a "$BPM_ROOT"/etc/shells -fi +for _shell in $SHELLS; do + if ! grep -q "^${_shell}\$" /etc/shells; then + echo "Adding '$_shell' to /etc/shells..." + echo "$_shell" | tee -a /etc/shells 1>/dev/null + fi +done diff --git a/post_remove.sh b/post_remove.sh index ae4bded..494ef9b 100644 --- a/post_remove.sh +++ b/post_remove.sh @@ -1,7 +1,10 @@ -#!/bin/bash +#!/bin/sh -SHELL="/bin/fish" +SHELLS="/bin/fish /usr/bin/fish" -if grep "${SHELL}" "$BPM_ROOT"/etc/shells; then - sed -i "\|${SHELL}|d" "$BPM_ROOT"/etc/shells -fi +for _shell in $SHELLS; do + if grep -q "^${_shell}\$" /etc/shells; then + echo "Removing '$_shell' from /etc/shells..." + sed -i "\|^${_shell}\$|d" /etc/shells + fi +done diff --git a/post_update.sh b/post_update.sh new file mode 100644 index 0000000..a7cdeac --- /dev/null +++ b/post_update.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +SHELLS="/bin/fish /usr/bin/fish" + +for _shell in $SHELLS; do + if ! grep -q "^${_shell}\$" /etc/shells; then + echo "Adding '$_shell' to /etc/shells..." + echo "$_shell" | tee -a /etc/shells 1>/dev/null + fi +done