#!/bin/bash

cat  > /etc/rsyslog.d/pppd.conf << EOF
template (
  name = "DynFile"
  type = "string"
  string = "/var/log/pppoe-%\$year%%\$month%%\$day%.log"
)
if (\$programname == 'pppd') then {
    action(type="omfile" dynaFile="DynFile")
    stop
}
EOF

systemctl restart rsyslog