PageRenderTime 24ms CodeModel.GetById 22ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/etckeeper/init.d/20restore-etckeeper

http://github.com/brinkman83/bashrc
Shell | 22 lines | 14 code | 3 blank | 5 comment | 2 complexity | 776ab5b122b16e71b155680a3a6d3189 MD5 | raw file
 1#!/bin/sh
 2set -e
 3
 4# Used by .etckeeper to run a command if the file it acts on
 5# (the last parameter) exists.
 6maybe () {
 7	command="$1"
 8	shift 1
 9
10	if eval [ -e "\$$#" ]; then
11		"$command" "$@"
12	fi
13}
14
15# Yes, this runs code from the repository. As documented, etckeeper-init
16# should only be run on repositories you trust.
17if [ -e .etckeeper ]; then
18	. ./.etckeeper
19else
20	touch .etckeeper
21	chmod 600 .etckeeper
22fi