- Enable owner write permission on config file
- Move the custom admin dir to default location
- Unpack diff
- Move the admin dir to custom location
- Restore original permissions on config file
- Get site directory
- Backup config file
- Enable owner write permission on config file
- Edit config file admin dir setting to default location
- Move the custom admin dir to default location
- Unpack diff
- Move the admin dir to custom location
- Edit config file admin dir setting to custom location
- Restore original permissions on config file
- Optional: Verify checksums
So here's the link to my GitHub repo: https://github.com/RytoEX/cmsms-update-script
The script is licensed under GPLv3. Anyone is welcome to submit issues, feature requests, or pull requests via GitHub. I'll also keep an eye on this thread. The script certainly needs some cleanup (still some hard-coded strings present), and I'm sure it needs improvements (quoted variables, for instance). As with any update process, you should back up your site before running this script.
I do have a couple of additional features I'd considered adding, such as:
- Offer an optional site directory backup
- Offer an optional automatic database backup using config.php values
- Attempt automatic download of diff/update file if one is not detected locally
- Attempt automatic download of checksum file if one is not detected locally
- Try to detect where the user is on the Upgrade Path
Usage Instructions
You can download a zip file containing the 0.8 release here. Then, upload it to your web server and unzip it, or unzip it on your and upload only the CMSMSUpdateDiff.sh file to your server. Upload your desired CMSMS 1.x diff file to the same directory as this script. Optionally, you can also upload the checksum file for the CMSMS version to which you are updating. Open a terminal for your server, and run the script with:
Code: Select all
./CMSMSUpdateDiff.sh
I apologize if I've left out any pertinent details in this post. It's rather late, but I wanted to post this now rather than put it off any longer. If this script helps even one other person, then I'm happy with that. If it doesn't help anyone other than myself, well then at least I had fun writing it.