Skip to content

Instantly share code, notes, and snippets.

@predominant
Created December 8, 2011 04:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save predominant/1446133 to your computer and use it in GitHub Desktop.
Save predominant/1446133 to your computer and use it in GitHub Desktop.
Automatic operations on logout from a server
#!/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
@gplv2
Copy link

gplv2 commented Mar 28, 2012

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment