Commit Graph

39 Commits

Author SHA1 Message Date
Steven Bakker
d2462e6fe4 Refactor init script
* Use a `Main` function so we can order stuff top-down.
 * Add warnings for interface-specific variables that are set globally.
2021-05-06 14:51:01 +02:00
Steven Bakker
fc750ae1c0 Remove SOCKET_PERMISSIONS again, add STATIC_STATE_FILE 2021-03-26 18:29:00 +01:00
Steven Bakker
c5ff2c5da9 Add SOCKET_PERMISSIONS handling 2021-03-26 17:57:40 +01:00
Steven Bakker
512f745d4f Get static mode to working state. 2021-03-26 12:28:45 +00:00
Steven Bakker
5931cd765c Initial commit for static mode support. 2021-03-25 17:23:30 +01:00
Steven Bakker
68bd86aa86 Eliminate trailing spaces in init script. 2021-03-02 11:49:02 +01:00
Steven Bakker
f55907c5fa Add feature of "interfaces.d" to init script and do some refactoring.
Instead of scouring /etc/default/arpsponge for "eth*" files, allow the
interface configurations to be located in the "interfaces.d" sub-directory,
taking any (non-hidden) file there as an interface configuration. This
allows for arbitrary interface names (enp57s0u1u1, wlp58s0, etc.).

If there are both eth* files in /etc/default/arpsponge /and/ the
"interfaces.d" directory exists, then a warning will be emitted and
the "interfaces.d" definitions will be used instead (i.e. the "legacy"
interface files will be ignored).

If no interface definitions are found, another warning is emitted.

Thanks to Leon Meßner (elonhub) for starting the discussion on this.
2021-03-02 11:40:31 +01:00
Marco d'Itri
3d04d9604b Source /lib/lsb/init-functions in the init script
This is needed at least to redirect the actions to systemctl when using
systemd.
2019-11-10 22:23:11 +01:00
Steven Bakker
94a9f7df36 Add --passive
Passive mode: don't send ARP queries from the sponge's IP.

Turn on --passive automatically if there is no IP address
associated with the sponge's network interface.
2019-03-28 12:13:47 +01:00
Steven Bakker
7b1cdd697e Add ETC_DEFAULT config variable. 2018-11-05 13:01:23 +01:00
Steven Bakker
f38bb5677c The asctl option is --interface, not --device. :-(
Closes: #2
2018-06-18 17:17:36 +02:00
Steven Bakker
0189ee973a Add --device option when loading status on re-init
Closes: #2

This was causing issues on hosts with more than one sponge
(i.e. monitoring multiple interfaces).
2018-06-18 14:40:54 +02:00
Steven Bakker
a0d77f9858 Add a PERMISSIONS configuration variable
Patch from Marco d'Itri <md@linux.it>
2018-05-14 15:58:21 +02:00
Steven Bakker
6a6d1932fe Remove SVN keywords from misc. files 2016-02-05 11:38:41 +01:00
Steven Bakker
4b66c7e63f Fix copyright notices 2016-02-05 11:37:43 +01:00
Steven Bakker
81729855d2 init script start/stop/status return codes 2015-03-06 18:31:59 +01:00
Steven Bakker
87fb3f6f2f Fix exit code. 2015-03-06 18:30:43 +01:00
Steven Bakker
1d11ecdaa5 Fix "status" to exit with appropriate code when there's no sponge running.
Also don't try to send a USR1 signal when not running as root.
2014-11-24 14:12:35 +00:00
Steven Bakker
33c47655cc Use "/bin/sh" instead of "/bin/bash" for init script. 2014-10-23 08:15:27 +00:00
Steven Bakker
1f1449ca04 Add "DISABLED" variable to init script and defaults.
Fix arpsponge POD to sort the init script variables.
2014-07-21 08:36:43 +00:00
Steven Bakker
d1f371e69b Include SWEEP_AT_START option (--sweep-at-start). 2014-05-12 12:23:17 +00:00
Steven Bakker
838fad9bff Make "start" and "restart" do a re-read of the state table as well.
Add a "flush" action to do a daemon restart with clean state table.
Add "help" action to show more help.
2014-05-12 11:44:30 +00:00
Steven Bakker
6c655ee671 Added patch for "--sweep-skip-alive" by Chris Caputo (SIX).
Also added controls for run-time setting.
Updated asctl's POD.
2013-05-01 14:29:13 +00:00
Steven Bakker
842ab1cb7e Fixed copyright info. 2011-09-20 14:42:56 +00:00
Steven Bakker
edbf50b33f Added ARP_UPDATE_METHOD. 2011-08-23 13:18:47 +00:00
Steven Bakker
379314a628 Dump status before stopping as well. 2011-07-06 09:36:03 +00:00
Steven Bakker
e03e27b188 (Force-)reload now causes the state to be re-read.
Fixed use of "ls" to find files.
2011-07-06 09:26:01 +00:00
Steven Bakker
53a28e11b6 * Fixed for new ARP sponge usage. --dummy and --daemon are no longer
mutually exclusive.
* Also added new "debug" argument.
2011-04-22 15:28:41 +00:00
Steven Bakker
1ae30dedd9 Fixed startup code. 2010-11-17 14:27:07 +00:00
Steven Bakker
6e8cd90633 Beter init script handling (DUMMY implies DEBUG).
Flood protection.
2010-11-17 11:28:27 +00:00
Steven Bakker
7fb1ac767b Don't really run if DEBUG is set. Fail if FIFO
creation fails. Only create notify FIFO if requested.
2010-11-17 11:13:00 +00:00
Steven Bakker
083a424f9a Let the install/remove of init links be handled automatically. 2010-08-10 15:20:24 +00:00
Steven Bakker
ebd8f9524d Added LSB init comments. 2010-08-10 14:59:45 +00:00
Steven Bakker
4bcc9868d7 Bug fix. 2005-10-26 11:44:29 +00:00
Steven Bakker
d49848087a Ouch! Forgot to remove a debug echo in init script. 2005-10-19 21:52:38 +00:00
Steven Bakker
47746078db Init changes. 2005-10-19 21:49:55 +00:00
Steven Bakker
c2e088c1c9 No longer needed. 2005-05-09 15:56:56 +00:00
Steven Bakker
6e9c83df8d Fixed arpswiffer->arpsponge 2005-05-09 15:54:59 +00:00
Steven Bakker
596f74efa7 Checking in first arpswiffer. 2005-05-03 14:31:59 +00:00