Skip to content

Instantly share code, notes, and snippets.

@aeppert
Created June 14, 2016 17:58
Show Gist options
  • Select an option

  • Save aeppert/670d0b579437b867ee1185973c5af99e to your computer and use it in GitHub Desktop.

Select an option

Save aeppert/670d0b579437b867ee1185973c5af99e to your computer and use it in GitHub Desktop.
Replace a string between markers using a variable
TLSDATE_CONFIG=" \
\thost 127.0.0.1\n\
\tport 8443\n \
\tproxy none"
sed -i -n "/source/{p;:a;N;/end/!ba;s/.*\n/${TLSDATE_CONFIG}\n/};p" /etc/tlsdate/tlsdated.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment