Skip to content

Instantly share code, notes, and snippets.

@gplv2
Forked from predominant/.bash_logout
Created March 28, 2012 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gplv2/2227703 to your computer and use it in GitHub Desktop.
Save gplv2/2227703 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment