#!/usr/bin/env bash # execute as root or use `sudo` [[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0") # changes in /etc/sympa/auth.conf sed -i 's/.*host 192.168.1.254:389.*/\thost 127.0.0.1:389/' /etc/sympa/auth.conf # start SSH port translation if needed if ! ss -tln | grep -q 127.0.0.1:389; then ssh -fN listes.artcode.re -L 389:192.168.1.254:389 systemctl restart wwsympa.socket echo 'SSH port translation 389 is now active!' else echo 'SSH already enabled!' fi