Skip to content

Instantly share code, notes, and snippets.

@azrdev
Created February 27, 2015 13:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azrdev/4c9b2729dae36973de66 to your computer and use it in GitHub Desktop.
Save azrdev/4c9b2729dae36973de66 to your computer and use it in GitHub Desktop.
systemd-unit file(s) for peervpn filtering annoying log messages

/etc/systemd/system/peervpn@.service /usr/local/sbin/peervpn-logfiltered.sh

Put these in place & do systemctl daemon-reload to allow for filtering that peervpn message from your log

#!/usr/bin/sh
/usr/bin/peervpn $* | sed -nue "/warning: could not send packet!/!p"
# To create a new PeerVPN instance called <name>, create a new configuration file
# /etc/peervpn/<name>.conf. You can use the provided example configuration file
# peervpn.conf as a template.
#
# After the configuration file is created, you can control the instance with
# systemctl using systemd unit named peervpn@<name>.service.
[Unit]
Description=PeerVPN Node (%i) logfiltered
After=syslog.target network.target
ConditionPathExists=/etc/peervpn/%i.conf
[Service]
Type=simple
ExecStart=/usr/local/sbin/peervpn-logfiltered.sh /etc/peervpn/%i.conf
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment