#!/bin/bash export PATH=${PATH}:/usr/local/sbin:/usr/local/bin function commit_dir { if [ -d ${1} ] then cd ${1} if [ ! -d .hg ] then hg init fi hg addremove hg commit --config ui.username="`hostname`" -m "Update `date`" fi } commit_dir /etc/ commit_dir /usr/local/etc/