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