added bins to remove and add sites, changed dockerfile. added new format

This commit is contained in:
lars-hagen
2019-12-25 20:43:33 +01:00
parent 316c348b5c
commit b5165fcd28
48 changed files with 4448 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
perl -0777 -p -i.bak -e "s/(vhTemplate centralConfigLog \{[^}]+)\}*(^$)/\1
member $1 {
vhDomain $1
}/gmi" httpd_config.conf
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
domain=${1//\./\\.}
#replace . with \.
#so example.com becomes example\.com, this is because in regex . is used for matching any character
#so the regex would match on example.com and example7com, because . matches on "7"
perl -0777 -p -i.bak -e "s/(vhtemplate centralConfigLog \{[^}]+)*(^.*member "$domain" \{.*[^}]*})/\1#thislinewillbedeletedj98311/gmi" httpd_config.conf
perl -i -ne '/#thislinewillbedeletedj98311/ or print' httpd_config.conf
#aboves replaces the matched group with a string and random numbers, then second command searches for that string and deletes the line
#if anyone can figure out how to do above in oneline, feel free to let us know