Skip to content

Commit 90f252d

Browse files
committed
fix: exit code 141 when attempting to save the current list
1 parent 71d8155 commit 90f252d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ipset-fast-update

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,13 @@ main() {
334334
fi
335335

336336
if [[ "${IPSET_SAVE_ON_STOP}" != "yes" ]]; then
337-
echo "--------------------------------------------------------------------------------------"
338-
echo "[WARNING]: IPSET_SAVE_ON_STOP in ${IPSET_CONFIG} is not set to yes."
339-
echo "It is recommended that you set it to 'yes' for the setting to take effect permanently."
340-
echo "If you do not want to save the configuration automatically, use the -t option."
341-
echo "--------------------------------------------------------------------------------------"
337+
cat << _EOF_
338+
--------------------------------------------------------------------------------------
339+
[WARNING]: IPSET_SAVE_ON_STOP in ${IPSET_CONFIG} is not set to yes.
340+
It is recommended that you set it to 'yes' for the setting to take effect permanently.
341+
If you do not want to save the configuration automatically, use the -t option.
342+
--------------------------------------------------------------------------------------
343+
_EOF_
342344
fi
343345
/usr/libexec/ipset/ipset.start-stop save
344346
fi
@@ -348,7 +350,7 @@ main() {
348350
[[ "${IS_VERBOSE}" -eq 1 ]] && echo "# Check set: ipset list -t ${SET_NAME}, ipset list ${SET_NAME}"
349351

350352
# Save current list file
351-
yes | mv "${LIST_FILE}" "${LIST_CURRENT_FILE}"
353+
cat "${LIST_FILE}" > "${LIST_CURRENT_FILE}"
352354
}
353355

354356
[[ ${#BASH_SOURCE[@]} = 1 ]] && main "$@"

0 commit comments

Comments
 (0)