Dabombber
Senior Member
Looks like diversion is reading /proc/swaps and messed up the logic a bit. Just ignore the message for now.
@thelonelycoder
From line 451
EDIT: Oh wait, I see what the last elif was for now. maybe use
before the -f check to detect multiple files.
@thelonelycoder
From line 451
Code:
else
# No reference in post-mount
swaplocation="$(find /tmp/mnt/*/myswap.swp 2> /dev/null)"
if [ "$(echo "$swaplocation" | wc -l)" -ge 2 ]; then
swtext=" Multiple swap files found, only one file is\\n supported. Run sw to delete."
elif [ -f "$swaplocation" ]; then
# File found without a reference
writeswaploc
swtext=" Added missing swap file entry to\\n /jffs/scripts/post-mount"
# elif [ "$(wc -l < /proc/swaps)" -ge "2" ]; then # should be -eq
# #Swap mounted without a reference (should be ignored, likely handled outside diversion)
# swaplocation="$(sed -n '2p' /proc/swaps | awk '{print $1}')"
# if [ -f "$swaplocation" ]; then
# writeswaploc
# swtext=" Added missing swap file entry to\\n /jffs/scripts/post-mount"
# else
# # Swap mounted with no file, ie a partition
# sed -i '\~swapon ~d' /jffs/scripts/post-mount
# swtext=" No swap file found, reference removed in\\n /jffs/scripts/post-mount"
# fi
#elif [ "$swaplocation" ]; then
elif [ "$(wc -l < /proc/swaps)" -gt 2 ]
# Multiple swaps mounted
fi
fi
EDIT: Oh wait, I see what the last elif was for now. maybe use
Code:
"$(echo "$swaplocation" | wc -l)" -ge 2
Last edited: