diff options
Diffstat (limited to 'git/set')
-rwxr-xr-x | git/set | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -0,0 +1,21 @@ +#!/bin/sh -e + +setting=$1 +shift +value=$1 +shift + +if [ $# -eq 0 ]; then + echo "usage: $0 setting value dir ..." 1>&2 + exit 1 +fi + +for d in "$@"; do + if [ -e "$d"/cgitrc ]; then + grep ^"$setting"= "$d"/cgitrc >/dev/null && + sed -i "s ^$setting=.* $setting=$value " "$d"/cgitrc || + echo "$setting=$value" >> "$d"/cgitrc + else + echo "$setting=$value" > "$d"/cgitrc + fi +done |