Greetings!
Just a quick question, I want to automate my Plex/Mullvad setup to work with split tunnelling after a reboot.
Currently, following a reboot, i need to run a few commands to get it up and running, these are:
-
systemctl status plexmediaserver
to get the PID for Plex (orps ax | grep 'plex'
if you're that way inclined) -
mullvad split-tunnel pid add <pid>
to add Plex PID to split tunnelling -
nft -f plex.rules
to allow listening on the Plex port
plex.rule contents:
table inet excludeTraffic {
chain allowIncoming {
type filter hook input priority -100; policy accept;
tcp dport 32400 ct mark set 0x00000f41 meta mark set 0x6d6f6c65;
}
chain allowOutgoing {
type route hook output priority -100; policy accept;
tcp sport 32400 ct mark set 0x00000f41 meta mark set 0x6d6f6c65;
}
}
Anyone know how it may be possible to automate the finding of the PID and then add it into a script with the rest of the needed commands?
I am researching it myself, just thought I'd ask.
Thanks in advance
Casu