mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-25 00:53:49 +01:00
Use -h rather than -L for checking a symlink
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
1fa77ac470
commit
d829093caa
@ -3864,7 +3864,7 @@ noiptrace_command() {
|
|||||||
verify_firewall_script() {
|
verify_firewall_script() {
|
||||||
if [ ! -f $g_firewall ]; then
|
if [ ! -f $g_firewall ]; then
|
||||||
echo " ERROR: $g_product is not properly installed" >&2
|
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 " $g_firewall is a symbolic link to a" >&2
|
||||||
echo " non-existant file" >&2
|
echo " non-existant file" >&2
|
||||||
else
|
else
|
||||||
|
@ -60,7 +60,7 @@ mywhich() {
|
|||||||
remove_file() # $1 = file to remove
|
remove_file() # $1 = file to remove
|
||||||
{
|
{
|
||||||
if [ -n "$1" ] ; then
|
if [ -n "$1" ] ; then
|
||||||
if [ -f $1 -o -L $1 ] ; then
|
if [ -f $1 -o -h $1 ] ; then
|
||||||
rm -f $1
|
rm -f $1
|
||||||
echo "$1 Removed"
|
echo "$1 Removed"
|
||||||
fi
|
fi
|
||||||
@ -84,7 +84,7 @@ remove_file_with_wildcard() # $1 = file with wildcard to remove
|
|||||||
if [ -d $f ] ; then
|
if [ -d $f ] ; then
|
||||||
rm -rf $f
|
rm -rf $f
|
||||||
echo "$f Removed"
|
echo "$f Removed"
|
||||||
elif [ -f $f -o -L $f ] ; then
|
elif [ -f $f -o -h $f ] ; then
|
||||||
rm -f $f
|
rm -f $f
|
||||||
echo "$f Removed"
|
echo "$f Removed"
|
||||||
fi
|
fi
|
||||||
|
@ -151,7 +151,7 @@ fi
|
|||||||
|
|
||||||
remove_file ${SBINDIR}/$PRODUCT
|
remove_file ${SBINDIR}/$PRODUCT
|
||||||
|
|
||||||
if [ -L ${SHAREDIR}/$PRODUCT/init ]; then
|
if [ -h ${SHAREDIR}/$PRODUCT/init ]; then
|
||||||
if [ $HOST = openwrt ]; then
|
if [ $HOST = openwrt ]; then
|
||||||
if [ $configure -eq 1 ] && /etc/init.d/$PRODUCT enabled; then
|
if [ $configure -eq 1 ] && /etc/init.d/$PRODUCT enabled; then
|
||||||
/etc/init.d/$PRODUCT disable
|
/etc/init.d/$PRODUCT disable
|
||||||
|
@ -151,7 +151,7 @@ fi
|
|||||||
|
|
||||||
remove_file ${SBINDIR}/$PRODUCT
|
remove_file ${SBINDIR}/$PRODUCT
|
||||||
|
|
||||||
if [ -L ${SHAREDIR}/$PRODUCT/init ]; then
|
if [ -h ${SHAREDIR}/$PRODUCT/init ]; then
|
||||||
FIREWALL=$(readlink -m -q ${SHAREDIR}/$PRODUCT/init)
|
FIREWALL=$(readlink -m -q ${SHAREDIR}/$PRODUCT/init)
|
||||||
elif [ -n "$INITFILE" ]; then
|
elif [ -n "$INITFILE" ]; then
|
||||||
FIREWALL=${INITDIR}/${INITFILE}
|
FIREWALL=${INITDIR}/${INITFILE}
|
||||||
|
Loading…
Reference in New Issue
Block a user