sdnbash() { # systemd namespace bash
local unit=$1
- m sudo nsenter -t $(systemctl show --property MainPID --value $unit') -n -m sudo -u $USER -i bash
+ m sudo nsenter -t $(systemctl show --property MainPID --value $unit) -n -m sudo -u $USER -i bash
}
mailnnbash() {
- m sudo nsenter -t $(systemctl show --property MainPID --value mailnn') -n -m sudo -u $USER -i bash
+ m sudo nsenter -t $(systemctl show --property MainPID --value mailnn) -n -m sudo -u $USER -i bash
}
mailvpnbash() {
m sudo nsenter -t $(pgrep -f "/usr/sbin/openvpn .* --config /etc/openvpn/.*mail.conf") -n -m sudo -u $USER -i bash
}
eximbash() {
- m sudo nsenter -t $(pgrep -f "/usr/sbin/exim4 -bd -q30m -C /etc/exim4/my.conf"|h1) -n -m sudo -u $USER -i bash
+ local pid
+ pid=$(pgrep -f "/usr/sbin/exim4 -bd -q30m -C /etc/exim4/my.conf"|h1)
+ if [[ ! $pid ]]; then
+ echo "eximbash: failed to find exim pid. systemctl -n 30 status exim4:"
+ systemctl status exim4
+ fi
+ m sudo nsenter -t $pid -n -m
}
spamnn() {
local spamdpid
sudo systemd-tty-ask-password-agent
}
-ufix() {
+fixu() {
ls -lad /run/user/1000
s chmod 700 /run/user/1000; s chown iank.iank /run/user/1000
}