Skip to content

Commit

Permalink
www#
Browse files Browse the repository at this point in the history
www#
  • Loading branch information
basilhendroff committed Oct 18, 2020
1 parent 8ccbe06 commit 28c79a9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions includes/wp-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
infile="/usr/local/www/wordpress/wp-config.php"
outfile="/usr/local/www/wordpress/wp-config.tmp"
cat $infile | while IFS= read -r line; do
case $line in
"<?php")
printf '%s\n' "$line" >> $outfile
cat /mnt/includes/fragment-1.php | while IFS= read -r frag; do
printf '%s\n' "$frag" >> $outfile
done
;;
*DB_PASSWORD*)
printf '%s\n' "$line" >> $outfile
cat /mnt/includes/fragment-2.php | while IFS= read -r frag; do
printf '%s\n' "$frag" >> $outfile
done
;;
"/* That's all, stop editing! Happy publishing. */")
cat /mnt/includes/fragment-3.php | while IFS= read -r frag; do
printf '%s\n' "$frag" >> $outfile
done
printf '%s\n' "$line" >> $outfile
;;
*)
printf '%s\n' "$line" >> $outfile
;;
esac
done
mv $outfile $infile

0 comments on commit 28c79a9

Please sign in to comment.