HP/Works

Home Join! Events PING! Committee Directory

PING : THE SOFTWARE DEPOT COOKBOOK : APPENDIX 3


#!/sbin/sh
# Post-Install Script Template for /opt

PATH=$SW_PATH:/sbin:/usr/bin:/usr/ccs/sbin
export PATH

# is it already there?

if grep -q /opt/xxx/bin /etc/PATH
then exit
fi

echo "add /opt/xxx/bin to the /etc/PATH file and"
echo "add /opt/xxx/man to the /etc/MANPATH file..."

mv /etc/PATH /etc/PATH.old
mv /etc/MANPATH /etc/MANPATH.old

awk '{print $1 ":/opt/xxx/bin" }' < /etc/PATH.old    >/etc/PATH
awk '{print $1 ":/opt/xxx/man" }' < /etc/MANPATH.old >/etc/MANPATH

if [ -f /etc/PATH ]
then rm -f /etc/PATH.old
fi

if [ -f /etc/MANPATH ]
then rm -f /etc/MANPATH.old
fi

Appendix 4


Home