Created
December 8, 2011 04:39
-
-
Save predominant/1446133 to your computer and use it in GitHub Desktop.
Automatic operations on logout from a server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## | |
## Commit configuration files. | |
## | |
if [ ! -d /etc/.git ]; then | |
cd /etc | |
git init | |
git config user.name "Server Administrator" | |
git config user.email "root@localhost" | |
fi | |
git --work-tree=/etc --git-dir=/etc/.git add . >/dev/null 2>&1 | |
git --work-tree=/etc --git-dir=/etc/.git commit -a -m "Logout commit `date +%c`" >/dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice, I was kinda looking for ideas around using git to keep track of configs... this sure gives ideas. I'll be forking this one for sure now :)