I was wondering why isn't this code working, it is simple but for some reason it's not working.
WIREGUARD_TEMP_NEW_CLIENT_INFO="# ef37a62148810e97daa4deb88fa7f8add6532c39d2feb56d712a0ab1e8f5fd13ec52cfb1751ad3812e21f33a1e0508f14b7d start
[Peer]
PublicKey = L5SCXFRI4Mhyo1nKTjs5d64CSGd36ehC8MD8jg2FbEM=
PresharedKey = 3sejb0srnD3ZHy4I3rydIqy6CPXEHwXWeoX2Yu/2msU=
AllowedIPs = 10.0.0.4/32,fd00:00:00::4/128
# ef37a62148810e97daa4deb88fa7f8add6532c39d2feb56d712a0ab1e8f5fd13ec52cfb1751ad3812e21f33a1e0508f14b7d end"
sed -i "$((6 * 4 - 6 + 11))i${WIREGUARD_TEMP_NEW_CLIENT_INFO}" /etc/wireguard/wg0.conf
The error I am getting is
sed: -e expression #1, char 113: unknown command: `['
What is the code doing?
It's just going to a given line number and adding the content to the given live number.