Changeset 59
- Timestamp:
- 04/06/2006 20:41:27 (6 years ago)
- Location:
- confman
- Files:
-
- 2 edited
-
confman (modified) (2 diffs)
-
confmanlib.sh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
confman/confman
r58 r59 1 #! / usr/local/bin/bash1 #! /bin/bash 2 2 # 3 3 # confman provides a command-line interface to Rescomp's server configuration … … 504 504 local count 505 505 506 # Let's see if we can read the file as ourself: 507 if [ ! -r $file ] ; then 508 usefile=`mktemp -t confman` 509 sudo cat $file > $usefile 510 else 511 usefile="$file" 512 cat $file > $usefile 513 fi 514 506 515 # Put all non-alphanumerics into a file 507 awk '{print $1}' $file | egrep -o "^[^-_A-Za-z0-9]" > $tmpfile 508 for char in `cat $file | sort | uniq` ; do 516 awk '{print $1}' $usefile | egrep -o \ 517 "^[^-_A-Za-z0-9]" > $tmpfile 518 519 for char in `cat $tmpfile | sort | uniq` ; do 509 520 count=`egrep -o "\\$char" $tmpfile | wc -l` 510 521 if [ $count -gt $biggestcount ] ; then -
confman/confmanlib.sh
r57 r59 1 #! /usr/local/bin/bash 1 #! /bin/bash 2 # 2 3 # This file provides shell libraries to our configuration management system. 3 4 # It will be sourced by the relevant Rescomp scripts. 4 5 # 6 # Author: Chris Cowart <ccowart@rescomp.berkeley.edu> 7 # Date: 30 March 2006 8 # 5 9 # $Id$ 6 10 … … 120 124 mode=`conf_get_prop ${myfile} mode` 121 125 comment=`conf_get_prop ${myfile} comment` 122 msg="This portion controlled under the ${layer} module."123 echo "${comment} $msg" >> $tmpfile124 126 cat $livepart >> $tmpfile 125 127 sudo rm $livepart … … 209 211 local myfile="${WORK_PATH}/${module}${file}" 210 212 local warning="${comment} ${CONF_WARNING}" 213 local morewarn="${comment} Managed under ${module} module." 211 214 local revision="${comment} \$Id\$" 212 215 echo $file 213 216 214 217 if [ -z $usefile ] ; then 215 echo -e "${warning}\n${revision}\n" > $myfile 216 elif head -n 1 ${file%-${module}} | grep '^#!' >/dev/null ; then 217 awk "{ if (NR==2) print \"\\n${warning}\\n${revision}\\n\"\$0; 218 else print \$0 }" ${file%-${module}} > $myfile 218 echo -e "${warning}\n${morewarn}\n${revision}\n" > $myfile 219 elif head -n 1 ${usefile} | grep '^#!' >/dev/null ; then 220 awk "{if (NR==2) 221 print \"\\n${warning}\\n${morewarn}\\n${revision}\\n\"\$0; 222 else print \$0 }" ${usefile} > $myfile 219 223 else 220 echo -e "${warning}\n${ revision}\n" > $myfile221 cat ${ file%-${module}} >> $myfile224 echo -e "${warning}\n${morewarn}\n${revision}\n" > $myfile 225 cat ${usefile} >> $myfile 222 226 fi 223 227
Note: See TracChangeset
for help on using the changeset viewer.
