Dotfiles/site-modules/core/files/bin/a2changedocumentroot
Ade Attwood 80239af169 refactor(core): start to make dotfiles public
This is the first commit that brings the privet dotfiles to a public
reop previously this was all one puppet module. Now this has been split
out so I can put all of the private files in a private puppet module
2020-09-20 06:22:17 +01:00

12 lines
274 B
Bash
Executable file

#!/bin/sh
if [ -z "$1" ] || [ -z "$2" ]; then
echo "USAGE: a2changedocumentroot new/documentroot apache/config/file"
exit 128
fi
sed -i "/DocumentRoot/c\ DocumentRoot $1" $2
echo "Document Root has been changed restarting apache"
sudo service apache2 restart