# --- # - Install scripts # --- cp /usr/local/sbin/ cp /usr/local/sbin/ # --- # - Configuration # --- mkdir -p /etc/check_net cp /etc/check_net/check_net.conf # - Adjust /etc/check_net/check_net.conf # - vim /etc/check_net/check_net.conf # --- # - systemd configuration for service "check_net" # --- # - Create service "check_net" # - cat < /etc/systemd/system/check_net.service [Unit] Description=Configure Routing for Internet Connections; After=network.target After=rc-local.service [Service] ExecStart=/usr/local/sbin/check_net.sh ExecStartPre=rm -rf /tmp/check_net.sh.LOCK ExecStopPost=rm -rf /tmp/check_net.sh.LOCK KillMode=control-group SendSIGKILL=yes TimeoutStopSec=2 Restart=on-failure [Install] WantedBy=multi-user.target EOF # - Activate service check_net # - systemctl enable check_net.service systemctl daemon-reload systemctl start check_net # --- # - Configure lograotation for service "check_net" # --- cat < /etc/logrotate.d/check_net /var/log/check_net.log { rotate 7 daily missingok notifempty copytruncate delaycompress compress } EOF