Configure service
This commit is contained in:
parent
671c53a809
commit
568405dc6a
11
configs/systemd/user/watch-ports.service
Normal file
11
configs/systemd/user/watch-ports.service
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description = Watch port open and close events
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
StandardOutput=syslog+console
|
||||||
|
ExecStart = python3 %h/.config/ewconfig/scripts/watch-ports
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -92,7 +92,7 @@ def print_changes(
|
|||||||
message = f"{proc_name} has {action} listening on {change['local']} port {change['port']}{proto_clean}"
|
message = f"{proc_name} has {action} listening on {change['local']} port {change['port']}{proto_clean}"
|
||||||
message = message[0].upper() + message[1:]
|
message = message[0].upper() + message[1:]
|
||||||
if args.output_mode == "print":
|
if args.output_mode == "print":
|
||||||
print(message)
|
print(message, flush=True)
|
||||||
else:
|
else:
|
||||||
logger.info(message)
|
logger.info(message)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user