Commit 1e141ac9 authored by Addshore's avatar Addshore 🏄
Browse files

Merge branch 'backupLocalSettings' into 'main'

Take backups of LocalSettings incase they get lost

See merge request releng/cli!6
parents 5bff8a2a 2be8b4b7
......@@ -270,6 +270,15 @@ var mwddMediawikiInstallCmd = &cobra.Command{
mwdd.DefaultForUser().Exec("mediawiki", []string{"chown", "-R", "nobody", "/var/www/html/w/data"}, exec.HandlerOptions{}, "root")
mwdd.DefaultForUser().Exec("mediawiki", []string{"chown", "-R", "nobody", "/var/log/mediawiki"}, exec.HandlerOptions{}, "root")
// Copy current local settings "somewhere safe", incase someone needs to restore it
currentTime := time.Now()
currentTimeString := currentTime.Format("20060102150405")
mwdd.DefaultForUser().Exec("mediawiki", []string{
"cp",
"/var/www/html/w/LocalSettings.php",
"/var/www/html/w/LocalSettings.php.mwdd.bak." + currentTimeString,
}, exec.HandlerOptions{}, User)
// Move custom LocalSetting.php so the install doesn't overwrite it
mwdd.DefaultForUser().Exec("mediawiki", []string{
"mv",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment