Escaping SED

I’m working on a boot script to build an Ubuntu 18.04.02 server.
I’ve included a screenshot because I thought the color coding might be easier on the eyes to see what’s going on.
I’m doing the update just to make sure it’s seeing fail2ban in the index and it’s installing ok.
It’s the next line (111) when I try to SED which IPs to ignore banning. I’ve used double quotes because I’m feeding it a variable and trying to doudle backslash any special characters to escape the double quotes… but I’m still getting an error of

sed: -e expression #1, char 55: unknown option to `s'

or after some tinkering now I’m getting…

sed: -e expression #1, char 33: unknown option to `s'
apt-get update
# Fail2Ban
apt-get -y install fail2ban
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sed -i "s\\/#ignoreip = 127.0.0.1\\/8 ::1\\/ignoreip = 127.0.0.1\\/8 ::1 10.0.16.0\\/24 ${IP_ADDRESS}\\/" /etc/fail2ban/jail.local

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.