Replace hard-coded path to ipset
The script currently contains a hard-coded path to ipset
(i.e., /usr/sbin/ipset
). But some Linux distributions have this tool in /sbin
instead of /usr/sbin
. It should be more universal and shouldn't rely on a specific path.
There are multiple ways how to resolve it:
- Accessing ipset using the
PATH
environment variable. - Trying several directories (at least /usr/sbin and /sbin).
- Some "autodetection" like
which ipset
.