This was happening when a unit was getting moved between networks and a totally different IP was found for it
Signed-off-by: Jed Reynolds <jed@candelatech.com>
- reformatted inconsistent indentation
- added options '-a' automatic '-h' help '-d' debug
- tests for '-t STDIN' to determine if interactive mode terminal
- prints diff -y comparison of diff files
- does not copy if no changes
- logs warnings and errors using logger
- you can check journalctl to see where backup and editfiles are
- reduces debug output
Signed-off-by: Jed Reynolds <jed@candelatech.com>
- avoids printing eth0 hostname multiple times
- stops printing LF-HOSTNAME-NEXT multiple times
- fixes die() on untracked ip address
- fixes warnings about duplicate IPs for hostnames
- writes to temp file before copying it over to /etc/hosts
- checks length of /tmp/t_hosts_X file and exits if length is zero
- backs up /etc/hosts to /etc/.hosts-$datetime before starting edits
Signed-off-by: Jed Reynolds <jed@candelatech.com>