This is a simple Linux script to update an git based project on a headless server. The script is designed to run with crontab but can also be run manually(however that defeats the purpose of the script).
git-updater
the_project_you_want_to_update
You need to configure the ABSOLUTE path to your project-directory (DIR variable line 3). And the name or command to start your project(RUNFILE variable line 6).
The script does 4 things.
- checks the git status. And If there is an update...
- Stops the project.
- Downloads the new version.
- Starts the project.