Use -h rather than -L for checking a symlink

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2018-07-26 13:51:30 -07:00
parent 1fa77ac470
commit d829093caa
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
4 changed files with 5 additions and 5 deletions

View File

@ -3864,7 +3864,7 @@ noiptrace_command() {
verify_firewall_script() {
if [ ! -f $g_firewall ]; then
echo " ERROR: $g_product is not properly installed" >&2
if [ -L $g_firewall ]; then
if [ -h $g_firewall ]; then
echo " $g_firewall is a symbolic link to a" >&2
echo " non-existant file" >&2
else

View File

@ -60,7 +60,7 @@ mywhich() {
remove_file() # $1 = file to remove
{
if [ -n "$1" ] ; then
if [ -f $1 -o -L $1 ] ; then
if [ -f $1 -o -h $1 ] ; then
rm -f $1
echo "$1 Removed"
fi
@ -84,7 +84,7 @@ remove_file_with_wildcard() # $1 = file with wildcard to remove
if [ -d $f ] ; then
rm -rf $f
echo "$f Removed"
elif [ -f $f -o -L $f ] ; then
elif [ -f $f -o -h $f ] ; then
rm -f $f
echo "$f Removed"
fi

View File

@ -151,7 +151,7 @@ fi
remove_file ${SBINDIR}/$PRODUCT
if [ -L ${SHAREDIR}/$PRODUCT/init ]; then
if [ -h ${SHAREDIR}/$PRODUCT/init ]; then
if [ $HOST = openwrt ]; then
if [ $configure -eq 1 ] && /etc/init.d/$PRODUCT enabled; then
/etc/init.d/$PRODUCT disable

View File

@ -151,7 +151,7 @@ fi
remove_file ${SBINDIR}/$PRODUCT
if [ -L ${SHAREDIR}/$PRODUCT/init ]; then
if [ -h ${SHAREDIR}/$PRODUCT/init ]; then
FIREWALL=$(readlink -m -q ${SHAREDIR}/$PRODUCT/init)
elif [ -n "$INITFILE" ]; then
FIREWALL=${INITDIR}/${INITFILE}