-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3a2344
commit 0b5b812
Showing
1 changed file
with
6 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,15 +29,17 @@ MOJ_COMPONENTS_FILE=/var/www/html/public/app/mu-plugins/wp-moj-components/compon | |
MOJ_COMPONENTS_SEARCH_EMAIL="justice\.web@digital\.justice\.gov\.uk" | ||
MOJ_COMPONENTS_REPLACE_EMAIL="[email protected]" | ||
|
||
|
||
# If search string is in file. Then replace it. | ||
if grep -q $MOJ_COMPONENTS_SEARCH_EMAIL $MOJ_COMPONENTS_FILE ; then | ||
echo "Replacing email text in wp-moj-components plugin." | ||
sed -i "s/$MOJ_COMPONENTS_SEARCH_EMAIL/$MOJ_COMPONENTS_REPLACE_EMAIL/g" $MOJ_COMPONENTS_FILE | ||
fi | ||
|
||
echo "Replacing paragraph text in wp-moj-components plugin" | ||
MOJ_COMPONENTS_SEARCH_PARAGRAPH="<p>This website is ([\w\W]*?)<\/p>" | ||
MOJ_COMPONENTS_REPLACE_PARAGRAPH="<p>This website is technically maintained by Justice Digital, Central Digital Product Team:<\/p>" | ||
MOJ_COMPONENTS_CONTENT=$(perl -0777pe 's/'"$MOJ_COMPONENTS_SEARCH_PARAGRAPH"'/'"$MOJ_COMPONENTS_REPLACE_PARAGRAPH"'/s' "$MOJ_COMPONENTS_FILE") | ||
echo "$MOJ_COMPONENTS_CONTENT" > "$MOJ_COMPONENTS_FILE" | ||
|
||
if [ -f "$MOJ_COMPONENTS_FILE" ] ; then | ||
echo "Replacing paragraph text in wp-moj-components plugin" | ||
MOJ_COMPONENTS_CONTENT=$(perl -0777pe 's/'"$MOJ_COMPONENTS_SEARCH_PARAGRAPH"'/'"$MOJ_COMPONENTS_REPLACE_PARAGRAPH"'/s' "$MOJ_COMPONENTS_FILE") | ||
echo "$MOJ_COMPONENTS_CONTENT" > "$MOJ_COMPONENTS_FILE" | ||
fi |