Last active
May 29, 2018 18:30
-
-
Save kenjiskywalker/4372273 to your computer and use it in GitHub Desktop.
/etc/cron.daily/etckeeper
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/sh | |
set -e | |
cd /etc/ | |
git_diff=`git diff | head -n1 | cut -d " " -f 1` | |
if [ -n "$git_diff" ] ; then | |
### IRC 通知処理 | |
exit | |
fi | |
if [ -x /usr/bin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then | |
. /etc/etckeeper/etckeeper.conf | |
if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then | |
# avoid autocommit if an install run is in progress | |
lockfile=/var/cache/etckeeper/packagelist.pre-install | |
if [ -e "$pe" ] && [ -n "$(find "$lockfile" -mtime +1)" ]; then | |
rm -f "$lockfile" # stale | |
fi | |
if [ ! -e "$lockfile" ]; then | |
AVOID_SPECIAL_FILE_WARNING=1 | |
export AVOID_SPECIAL_FILE_WARNING | |
if etckeeper unclean; then | |
etckeeper commit "daily autocommit" >/dev/null | |
fi | |
fi | |
fi | |
fi | |
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
# The VCS to use. | |
#VCS="hg" | |
VCS="git" | |
#VCS="bzr" | |
#VCS="darcs" | |
# Options passed to git commit when run by etckeeper. | |
GIT_COMMIT_OPTIONS="" | |
# Options passed to hg commit when run by etckeeper. | |
HG_COMMIT_OPTIONS="" | |
# Options passed to bzr commit when run by etckeeper. | |
BZR_COMMIT_OPTIONS="" | |
# Options passed to darcs record when run by etckeeper. | |
DARCS_COMMIT_OPTIONS="-a" | |
# Uncomment to avoid etckeeper committing existing changes | |
# to /etc automatically once per day. | |
#AVOID_DAILY_AUTOCOMMITS=1 | |
AVOID_DAILY_AUTOCOMMITS=1 | |
# Uncomment the following to avoid special file warning | |
# (the option is enabled automatically by cronjob regardless). | |
#AVOID_SPECIAL_FILE_WARNING=1 | |
# Uncomment to avoid etckeeper committing existing changes to | |
# /etc before installation. It will cancel the installation, | |
# so you can commit the changes by hand. | |
#AVOID_COMMIT_BEFORE_INSTALL=1 | |
# The high-level package manager that's being used. | |
# (apt, pacman-g2, yum etc) | |
HIGHLEVEL_PACKAGE_MANAGER=yum | |
# The low-level package manager that's being used. | |
# (dpkg, rpm, pacman-g2, etc) | |
LOWLEVEL_PACKAGE_MANAGER=rpm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment