#!/bin/sh
[ "$1" != "upgrade" ] || exit 0
set -e
        # Add path to remove dir in case we removed our only grep
        if [ "x$D" = "x" ] ; then
           for busybox_rmdir in /tmp/busyboxrm-*; do
               if [ "$busybox_rmdir" != '/tmp/busyboxrm-*' ] ; then
                  export PATH=$busybox_rmdir:$PATH
               fi
           done
        fi

	if grep -q "^/bin/bash$" $D/etc/busybox.links* && [ ! -e $D/bin/bash ]; then
		printf "$(grep -v "^/bin/bash$" $D/etc/shells)\n" > $D/etc/shells
	fi
