cScm Configuration Daemon

cScm – is a tool to convert SCM configuration files into binary format and store its in shared memory for reading by cSvn-ui and cGit-ui CGI scripts

2 Commits   0 Branches   1 Tag
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  1) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  2) config() {
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  3)   NEW="$1"
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  4)   OLD="`dirname $NEW`/`basename $NEW .new`"
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  5)   # If there's no config file by that name, mv it over:
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  6)   if [ ! -r $OLD ]; then
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  7)     mv $NEW $OLD
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  8)   elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
12c7b1c5 (kx 2023-03-24 02:53:04 +0300  9)     rm $NEW
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 10)   fi
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 11)   # Otherwise, we leave the .new copy for the admin to consider...
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 12) }
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 13) 
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 14) config etc/rc.d/rc.csvnd.new
12c7b1c5 (kx 2023-03-24 02:53:04 +0300 15) config etc/rc.d/rc.cgitd.new