Loading...
 

RCS

cd into the directory with the files to go under RCS and create and RCS subdirectory

$ cd squid-warp/
$ mkdir RCS
$ ls -lh
total 60K
-rw-r--r--. 1 ec2-user ec2-user 419 Nov 11 2010 cachemgr.conf
-rw-r--r--. 1 root root 419 Nov 11 2010 cachemgr.conf.default
-rw-r--r--. 1 root root 1.4K Nov 11 2010 errorpage.css
-rw-r--r--. 1 root root 1.4K Nov 11 2010 errorpage.css.default
-rw-r--r--. 1 root root 12K Nov 11 2010 mime.conf
-rw-r--r--. 1 root root 12K Nov 11 2010 mime.conf.default
-rw-r--r--. 1 root root 421 Nov 11 2010 msntauth.conf
-rw-r--r--. 1 root root 421 Nov 11 2010 msntauth.conf.default
drwxrwxr-x. 2 ec2-user ec2-user 4.0K Feb 22 14:52 RCS
-rw-r-----. 1 ec2-user ec2-user 2.5K Nov 11 2010 squid.conf
-rw-r--r--. 1 root root 2.5K Nov 11 2010 squid.conf.default

Install the files into RCS

$ rcs -i squid.conf cachemgr.conf
RCS file: RCS/squid.conf,v
enter description, terminated with single ‘.’ or end of file:
NOTE: This is NOT the log message!
>> adding to RCS
>> .
done
RCS file: RCS/cachemgr.conf,v
enter description, terminated with single ‘.’ or end of file:
NOTE: This is NOT the log message!
>> adding to RCS
>> .
done

And check them in

$ ci -u squid.conf cachemgr.conf
RCS/squid.conf,v <-- squid.conf
initial revision: 1.1
done
RCS/cachemgr.conf,v <-- cachemgr.conf
initial revision: 1.1
done

The following script can then be used to easily manage the editing of files

$ cat /usr/local/bin/visquid

  1. !/bin/sh

file=/etc/squid-$1/$2.conf
/usr/bin/co -l $file
/usr/bin/vim $file
/usr/bin/rcsdiff -u $file
/usr/bin/ci -u $file