#!/bin/sh # # This script changes PATH/SUPATH variables in the /etc/default/login file, to # allow for "/usr/local/(s)bin. # Again, a derived work from the scripts included in JASS # Harry Hoffman # LOGIN=${JASS_ROOT_DIR}/etc/default/login logMessage "Adding /usr/local to default PATH." if [ ! -f ${LOGIN} ]; then create_a_file -m 444 -o root:sys ${LOGIN} fi if [ `grep -c "^[^#]*PATH=.*$" ${LOGIN}` = 0 ]; then backup_file ${LOGIN} logMessage "Setting the 'PATH' parameter in the file, ${LOGIN}." # First uncomment the "PATH" parameter if it already # exists. Otherwise, check for its existance and add it # to the file at the end if necessary. cat ${LOGIN}.${JASS_SUFFIX} |\ sed -e 's/#PATH=.*/PATH=\/bin:\/usr\/bin:\/usr\/sbin:\/usr\/local\/bin/g' \ -e 's/#SUPATH=.*/SUPATH=\/bin:\/sbin:\/usr\/bin:\/usr\/sbin:\/usr\/local\/bin:\/usr\/local\/sbin/g' > ${LOGIN} fi