diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-20 21:44:04 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-20 21:44:58 +0200 |
commit | f042c1f3d2c28b12bcceb5c21481514eeb628650 (patch) | |
tree | 8244768ea8d651208800e93c574a66664b79e810 | |
parent | 78d047863a86933693470a70ef6c0e6e07ecd4c5 (diff) | |
download | rbsd-f042c1f3d2c28b12bcceb5c21481514eeb628650.tar.gz |
Add /git/sec script
-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 |