/[fai]/trunk/lib/subroutines
ViewVC logotype

Contents of /trunk/lib/subroutines

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4921 - (hide annotations) (download)
Tue May 27 13:33:30 2008 UTC (4 years, 11 months ago) by lange
File size: 17029 byte(s)
fix regex so softupdate will; now umount the config space
1 lange 2102 #! /bin/bash
2 lange 1370
3 lange 1300 # $Id$
4     #*********************************************************************
5     #
6     # subroutines -- useful subroutines for FAI
7     #
8     # This script is part of FAI (Fully Automatic Installation)
9 lange 4921 # (c) 2000-2008 by Thomas Lange, lange@informatik.uni-koeln.de
10 lange 1300 # Universitaet zu Koeln
11     #
12     #*********************************************************************
13     # This program is free software; you can redistribute it and/or modify
14     # it under the terms of the GNU General Public License as published by
15     # the Free Software Foundation; either version 2 of the License, or
16     # (at your option) any later version.
17     #
18     # This program is distributed in the hope that it will be useful, but
19     # WITHOUT ANY WARRANTY; without even the implied warranty of
20     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21     # General Public License for more details.
22     #
23     # A copy of the GNU General Public License is available as
24     # `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
25     # or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You
26     # can also obtain it by writing to the Free Software Foundation, Inc.,
27 lange 4677 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28 lange 1300 #*********************************************************************
29    
30     # source this file, then you have these function available in the shell
31    
32     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
33     die() {
34    
35     # echo comment and exit installation
36 lange 2600 task_savelog
37 lange 1300 echo "$@"
38 lange 4137 if [ X$FAI_ACTION = Xinstall ]; then
39     exec bash -i
40     else
41     exit 99
42     fi
43 lange 1300 }
44     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
45     defnop() {
46    
47     # define given list of subroutine names as dummy function;
48     # this will fake unknown commands
49    
50     local name
51     for name in "$@";do
52     eval "$name () { :;}"
53     done
54     }
55     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
56 lange 3621 ### BEGIN SUBROUTINE INFO
57     # Provides-Var: none
58     # Required-Var: $classes
59     # Short-Description: test if class is defined
60     ### END SUBROUTINE INFO
61    
62 lange 1300 ifclass() {
63    
64 lange 4241 [ "$debug" ] && echo "Test if class $1 is in $classes" >&2
65 lange 1300 # test if a class is defined
66     local cl
67 lange 1401 local ret=1
68    
69 lange 1300 for cl in $classes; do
70 lange 1401 [ x$cl = x$1 ] && ret=0 && break
71 lange 1300 done
72 lange 4241 [ "$debug" ] && echo "ifclass returns $ret" >&2
73 lange 1401 return $ret
74 lange 1300 }
75     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
76     rwmount() {
77    
78     # remount partition read/write
79     mount -o rw,remount $1
80     }
81     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
82     save_dmesg() {
83    
84     dmesg > $LOGDIR/dmesg.log
85     }
86     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
87     wait_for_jobs() {
88    
89 lange 1329 # can be an extern script
90 lange 1300 # wait for running (background) jobs to finish (e.g. update-auctex-elisp)
91     local i=0
92 lange 2090 while jobsrunning; do
93 lange 1300 [ $(($i % 3)) -eq 0 ] && echo "Waiting for background jobs to finish."
94 lange 3635 (( i += 1 ))
95 lange 1300 sleep 10
96     done
97     }
98     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
99 lange 4688 stop_fai_installation() {
100    
101     # this subroutine should directly stop the installation process
102 lange 4739 echo "Traceback: $task_error_func"
103     die "FATAL ERROR. Installation stopped."
104 lange 4688 }
105     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
106 lange 3621 ### BEGIN SUBROUTINE INFO
107 lange 3822 # Provides-Var: $task_error
108 lange 4716 # Required-Var: $1 $2 $task_error
109     # Short-Description: save the maximum error code,
110     # Short-Description: $1 is the error that will be saved unless $2 is zero
111 lange 4681 ### END SUBROUTINE INFO
112    
113     task_error() {
114    
115 lange 4716 [ X$2 = X0 ] && return
116 lange 4739 task_error_func=${FUNCNAME[*]}
117 lange 4733 [ $1 -gt $task_error ] && task_error=$1
118 lange 4688 [ $task_error -gt $STOP_ON_ERROR ] && stop_fai_installation
119 lange 4681 }
120     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
121     ### BEGIN SUBROUTINE INFO
122     # Provides-Var: $task_error
123 lange 3621 # Required-Var: $LOGDIR
124     # Short-Description: call a certain task
125     ### END SUBROUTINE INFO
126    
127 lange 1300 task() {
128    
129     # hooks are called before a task is called
130     # if a task is skipped, also its hooks are skipped
131     # a hook can set the flag, so the accociated task is skipped
132    
133     local taskname=$1
134    
135     [ -f $LOGDIR/skip.$taskname ] || call_hook $taskname
136    
137     if [ -f $LOGDIR/skip.$taskname ]; then
138     # skip task
139 lange 3415 rm $LOGDIR/skip.$taskname # TODO: remove skip files at the very end
140 lange 1300 [ "$verbose" ] && echo "Skiping task_$taskname"
141 lange 4085 sendmon "TASKSKIP $taskname"
142 lange 1300 else
143     echo "Calling task_$taskname"
144 lange 4085 sendmon "TASKBEGIN $taskname"
145 lange 3822 task_error=0 # task can set this variable to indicate an error
146 lange 4739 task_error_func=''
147 lange 1300 task_$taskname
148 lange 4085 sendmon "TASKEND $taskname $task_error"
149 lange 4733 [ "$task_error" -ne 0 ] && echo "Exit code task_$taskname: $task_error"
150 lange 1300 fi
151 lange 1586 # since the subroutine is not needed any more, we can undefine it
152     unset task_$taskname
153 lange 1300 }
154     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
155 lange 3621 ### BEGIN SUBROUTINE INFO
156     # Provides-Var:
157     # Required-Var: $classes $debug
158     # Short-Description: call a hook, hook.source can define additional variables
159     ### END SUBROUTINE INFO
160    
161 lange 1300 call_hook() {
162    
163     local hook=$1
164     local cl dflag hfile
165     [ "$debug" ] && dflag="-d"
166    
167     for cl in $classes; do
168 lange 1459 hfile=$FAI/hooks/$hook.$cl
169 lange 3071 if [ -f $hfile -a ! -x $hfile ]; then
170     echo "WARNING: Skipping $hfile execustion because it's not executable."
171     continue
172     fi
173     if [ -f $hfile.source -a ! -x $hfile.source ]; then
174     echo "WARNING: Skipping $hfile.source execustion because it's not executable."
175     continue
176     fi
177 lange 1300 if [ -x $hfile ]; then
178 lange 1454 echo "Calling hook: $hook.$cl"
179 lange 4085 sendmon "HOOK $hook.$cl"
180 lange 1300 # execute the hook
181     $hfile $dflag
182 lange 1459 check_status $hook.$cl $?
183 lange 1300 fi
184     if [ -x $hfile.source ]; then
185 lange 1453 echo "Source hook: $hook.$cl.source"
186 lange 4085 sendmon "HOOK $hook.$cl.source"
187 lange 2390 # source this hook
188 lange 1300 . $hfile.source $dflag
189 lange 1459 check_status $hook.$cl.source $?
190 lange 1300 fi
191     done
192     }
193     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
194     skiptask() {
195    
196     # mark all given tasks, so they will be skipped
197     local task
198    
199 lange 3415 for task in "$@"; do
200 lange 1300 > $LOGDIR/skip.$task
201     done
202     }
203     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
204     define_fai_flags() {
205    
206 lange 1586 local flag
207 lange 1464 # FAI_FLAGS are comma separated, define all flags
208 lange 1683 FAI_FLAGS=${FAI_FLAGS//,/ }
209 lange 3823 echo "FAI_FLAGS: $FAI_FLAGS"
210 lange 1300 for flag in $FAI_FLAGS; do
211     # define this flag as 1
212 lange 3828 eval "flag_$flag=1"
213 lange 1300 done
214 lange 3823 [ "$flag_verbose" ] && verbose=1 # for backward compability
215     [ "$flag_debug" ] && debug=1 # for backward compability
216 lange 1300 }
217     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
218 lange 3621 ### BEGIN SUBROUTINE INFO
219 lange 3848 # Provides-Var: $fai_rundate
220 lange 3831 # Requires-Var: $DOMAIN $do_init_tasks
221 lange 3823 # Suggests-Var: $flag_createvt $flag_sshd
222 lange 3621 # Short-Description: <task desc.>
223     ### END SUBROUTINE INFO
224    
225 lange 1300 task_setup() {
226    
227 lange 1640 # source user specific subroutines
228     [ -f $FAI/hooks/subroutines ] && . $FAI/hooks/subroutines
229 lange 1300
230 lange 3925 if [ -f /boot/RUNNING_FROM_FAICD ]; then
231     local cdrom=$(mount| awk '/dev.+on \/ /{print $1}')
232     hdparm -d $cdrom | grep -q off 2>/dev/null
233     if [ $? -eq 0 ]; then
234     echo "WARNING: CD-ROM does not use DMA mode. The installation will be sloooow."
235     fi
236     fi
237    
238 lange 1300 define_fai_flags
239    
240 lange 3392 # this may be moved to an external script
241 lange 3831 if [ $do_init_tasks -eq 1 ] ; then
242 lange 3392 # set the system time and date using rdate or/and ntpdate
243     [ "$TIMESRVS_1" ] && rdate $TIMESRVS_1
244 lange 3961 [ "$NTPSRVS_1" ] && ntpdate -b $NTPSRVS
245 lange 3823 [ "$flag_createvt" ] && {
246 lange 2671 # create two virtual terminals; acces via alt-F2 and alt-F3
247     echo "Press ctrl-c to interrupt FAI and to get a shell"
248     openvt -c2 /bin/bash ; openvt -c3 /bin/bash
249     trap 'echo "You can reboot with faireboot";bash' INT QUIT
250     }
251    
252     # start secure shell daemon for remote access
253 lange 3823 [ "$flag_sshd" -a -x /usr/sbin/sshd ] && /usr/sbin/sshd
254 lange 2671 fi
255 lange 3823 unset flag_createvt flag_sshd
256 lange 1300
257     # when did FAI start, using localtime
258 lange 4755 [ -z "$fai_rundate" ] && fai_rundate=$(date +'%Y%m%d_%H%M%S')
259 lange 1300 }
260     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
261 lange 3621 ### BEGIN SUBROUTINE INFO
262     # Provides-Var: none
263     # Requires-Var: $FAI_ACTION
264     # Short-Description: call task depending on $FAI_ACTION
265     ### END SUBROUTINE INFO
266    
267 lange 1300 task_action() {
268    
269 lange 1630 if [ -z "$FAI_ACTION" ]; then
270     echo "No action in \$FAI_ACTION defined."
271 lange 4085 sendmon "TASKERROR action 21"
272 lange 2012 task_faiend
273 lange 1630 exit
274     fi
275 lange 1300 echo "FAI_ACTION: $FAI_ACTION"
276     case $FAI_ACTION in
277    
278     install)
279 lange 3831 if [ $do_init_tasks -eq 0 ]; then
280 lange 2757 echo "Cowardly refusing to run a FAI installation on a running system."
281     return
282     fi
283 lange 1690 echo Performing FAI installation. All data may be overwritten!
284 lange 1689 echo -ne "\a"; sleep 1
285     echo -ne "\a"; sleep 1
286 lange 1700 echo -e "\a"; sleep 5
287 lange 1300 task install
288 lange 2108 task faiend
289 lange 1300 ;;
290 lange 4074 dirinstall)
291     task dirinstall
292 lange 3783 ;;
293 lange 2671 softupdate)
294     echo Performing FAI system update. All data may be overwritten!
295     task softupdate
296     ;;
297 lange 1300 sysinfo)
298     echo Showing system information.
299     task sysinfo
300 lange 2108 task_faiend
301 lange 1300 die Now you have a shell.
302     ;;
303     *)
304     if [ -f $FAI/hooks/$FAI_ACTION ]; then
305     echo "Calling user defined action: $FAI_ACTION"
306     $FAI/hooks/$FAI_ACTION
307     else
308     echo "ERROR: User defined action $FAI/hooks/$FAI_ACTION not found."
309 lange 4085 sendmon "TASKERROR action 22"
310 lange 1300 task_faiend
311     fi
312     ;;
313     esac
314     }
315     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
316 lange 3621 ### BEGIN SUBROUTINE INFO
317     # Provides-Var: $classes $cfclasses
318     # Requires-Var: $LOGDIR
319     # Suggests-Var: $renewclass
320     # Short-Description: <task desc.>
321     ### END SUBROUTINE INFO
322    
323 lange 1300 task_defclass() {
324    
325 lange 2290 if [ ! -d $FAI/class ]; then
326 lange 4085 sendmon "TASKERROR defclass 21"
327 lange 2290 echo "Directory $FAI/class not found. Following subdirectories are found:"
328 lange 4063 find $FAI -maxdepth 1 -type d -printf "%p\n"
329 lange 2290 die "Aborting."
330     fi
331    
332 lange 1347 # new script for defining classes; variables imported: $LOGDIR, $verbose, $debug
333 lange 2757 if [ $renewclass -eq 1 ]; then
334     # reevaluate new list of classes
335     fai-class -T $FAI/class $LOGDIR/FAI_CLASSES
336     classes=$(< $LOGDIR/FAI_CLASSES)
337 lange 3796 elif [ -n "$cmdlineclasses" ]; then
338     classes=$cmdlineclasses
339 lange 4509 elif [ ! -f /var/lib/fai/FAI_CLASSES ]; then
340 lange 2757 # use classes defined at installation time
341 lange 4509 die "Try to read classes from /var/lib/fai/FAI_CLASSES. Failed. Aborting."
342 lange 3796 else
343 lange 4509 classes=$(< /var/lib/fai/FAI_CLASSES)
344 lange 2757 fi
345 lange 3806 echo "List of all classes: " $classes
346 lange 1300
347     # define classes as: a.b.c.d for cfengine -D
348     # this doesn't work without echo
349 lange 2259 cfclasses=$(echo $classes)
350 lange 1300 cfclasses=${cfclasses// /.}
351     [ "$debug" ] && echo "cfclasses: $cfclasses"
352     }
353     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
354 lange 3300 _defvar() {
355    
356     local showvar=1 # TODO: new FAI_FLAG or always set when verbose is used
357 lange 3309 [ "$showvar" ] && set -x
358 lange 3300 . $1 </dev/null
359 lange 3309 [ "$showvar" ] && set +x
360 lange 3300 }
361     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
362 lange 1300 task_defvar() {
363    
364 lange 3781 local svar=$LOGDIR/showvar.log
365 lange 4133 local odir=$(pwd)
366 lange 1300 cd $FAI/class
367     for class in $classes ; do
368     if [ -f $class.var ]; then
369     [ "$verbose" ] && echo "Executing $class.var"
370 lange 3300 # show only lines with ++, we cannot use a pipe, since it would call
371     # _devfar in a subprocess. Then, variables are not defined
372 lange 3414 _defvar $class.var > $svar 2>&1
373     grep ^++ $svar
374     rm $svar
375 lange 1300 fi
376     done
377    
378     # /fai/class/S* scripts or hooks can write variable definitions
379     # to additonal.var. now source these definitions
380 lange 3300 if [ -f $LOGDIR/additional.var ]; then
381 lange 3414 _defvar $LOGDIR/additional.var > $svar 2>&1
382     grep ^++ $svar
383     rm $svar
384 lange 3300 fi
385 lange 3685 unset class svar
386 lange 3881 # now all variables are defined. Dump them to variables.log
387     set | perl -ne 'print if /^\w\w+=/ and not /^(BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID|rootpw|ROOTPW|HOME|PWD)/' > $LOGDIR/variables.log
388 lange 4133 cd $odir
389 lange 1300 }
390     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
391     task_mountdisks() {
392    
393 lange 3705 [ ! -f $LOGDIR/fstab ] && die "No $LOGDIR/fstab created."
394 lange 2166 # mount swap space
395     local sd
396     for sd in $SWAPLIST; do
397 lange 4533 swapon -p1 $sd && [ "$verbose" ] && echo "Enable swap device $sd"
398 lange 2166 done
399 lange 3705 mount2dir $FAI_ROOT $LOGDIR/fstab
400 lange 1300 }
401     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
402     task_configure() {
403    
404 lange 1761 fai-do-scripts $FAI/scripts
405 lange 1300 }
406     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
407 lange 4714 task_test() {
408    
409     echo "Will be implemented soon"
410     }
411     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
412 lange 1300 task_savelog() {
413    
414 lange 4365 mkdir -p $FAI_ROOT/var/lib/fai
415     mkdir -p $FAI_ROOT/var/log/fai
416 lange 3887 fai-savelog -l
417 lange 3896 [ -f $LOGDIR/FAI_CLASSES ] && cp -pu $LOGDIR/FAI_CLASSES $FAI_ROOT/var/lib/fai
418     [ -f $LOGDIR/disk_var.sh ] && cp -pu $LOGDIR/disk_var.sh $FAI_ROOT/var/lib/fai
419 lange 1369 fai-savelog -r
420 lange 1300 }
421     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
422     task_faiend() {
423    
424 lange 3925 local dir cdromdevice
425 lange 3831 [ $do_init_tasks -eq 0 ] && exit 0
426 lange 1300 wait_for_jobs
427 lange 4370 echo "Press <RETURN> to reboot."
428 lange 3946 [ -z "$flag_reboot" ] && : ${flag_reboot:=0}
429 lange 4446 [ -s $LOGDIR/error.log -a "$flag_reboot" -gt "0" ] && sleep 10
430 lange 1300 # reboot without prompting if FAI_FLAG reboot is set
431 lange 3944 [ "$flag_reboot" -lt "1" ] && read
432 lange 1300 echo "Rebooting $HOSTNAME now"
433 lange 4547 sendmon "TASKEND REBOOT 0"
434 lange 1300 cd /
435     sync
436 lange 2012
437 lange 3971 killall -q sshd udevd
438 lange 3925 if [ -f /boot/RUNNING_FROM_FAICD ]; then
439     cat > $target/tmp/rebootCD <<'EOF'
440     #! /bin/bash
441 lange 4083 device=$1
442 lange 3925 eject -m /dev/$device 2>/dev/null >/dev/null
443     echo "Remove CDROM and press <RETURN> to continue reboot"
444     read
445     eject -t /dev/$device 2>/dev/null >/dev/null
446     exec reboot -df
447     EOF
448     chmod +x $target/tmp/rebootCD
449     sync
450     for dir in $(mount | grep $target | awk '{print $3}' | sort -r); do
451     mount -o remount,ro $dir
452     done
453 lange 3934 cdromdevice=$(awk '/ name:/ {print $3}' /proc/sys/dev/cdrom/info)
454 lange 3925 chroot $target /tmp/rebootCD $cdromdevice
455 lange 3937 # never reached, because chroot will reboot the machine
456     die "Internal error when calling /tmp/rebootCD."
457 lange 3925 fi
458 lange 3787 umount $FAI_ROOT/proc
459     umount -ar
460     exec reboot -dfi
461 lange 1300 }
462     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
463     task_install() {
464    
465 lange 4709 echo $$ > $stamp
466 lange 1300
467     save_dmesg
468    
469     task partition
470     task mountdisks
471     task extrbase
472     task mirror
473 lange 2612 task debconf
474 lange 2671 task prepareapt
475 lange 1300 task updatebase
476     task instsoft
477     task configure
478     task finish
479     task chboot
480    
481     rm -f $stamp
482     # save again, because new messages could be created
483     save_dmesg
484 lange 4714 task test
485 lange 1300 task savelog
486    
487     if [ -f $stamp ]; then
488     echo "Error while executing commands in subshell."
489 lange 4709 echo -n "$stamp was not removed. PID of running process: "
490     cat $stamp
491 lange 4085 sendmon "TASKERROR install 21"
492 lange 1300 die "Please look at the log files in $LOGDIR for errors."
493     fi
494     }
495     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
496 lange 4074 task_dirinstall() {
497 lange 3783
498 lange 4709 echo $$ > $stamp
499 lange 3783
500 lange 3787 mkdir -p $FAI_ROOT
501 lange 4133 FAI_ROOT=$(cd $FAI_ROOT;pwd)
502     echo "Installing into directory $FAI_ROOT"
503 lange 3783 task extrbase
504 lange 3945 [ -f $target/etc/fstab ] || touch $target/etc/fstab
505 lange 3783 task mirror
506     task debconf
507     task prepareapt
508     task updatebase
509     task instsoft
510     task configure
511 lange 3791 task finish
512 lange 3783
513     rm -f $stamp
514 lange 3801 unset LOGUSER # so logfile are not saved to remote
515     task savelog
516 lange 3783
517     if [ -f $stamp ]; then
518     echo "Error while executing commands in subshell."
519 lange 4709 echo -n "$stamp was not removed. PID of running process: "
520     cat $stamp
521 lange 4085 sendmon "TASKERROR install 21"
522 lange 3783 die "Please look at the log files in $LOGDIR for errors."
523     fi
524     }
525     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
526 lange 2671 task_softupdate() {
527    
528 lange 4818 stamp=/var/run/fai/fai_softupdate_is_running
529 lange 3092
530 lange 4066 [ -f "$stamp" ] && die "Another fai softupdate is already running. Aborting."
531 lange 4709 echo $$ > $stamp
532 lange 4078 # if the system had been installed using fai < 3.0 disk_var.sh is found in /etc/fai
533     if [ ! -f /var/lib/fai/disk_var.sh -a -f /etc/fai/disk_var.sh ] ; then
534     mv /etc/fai/disk_var.sh /var/lib/fai/
535     fi
536     # the following copy operation is required to make $LOGDIR a reliable source
537     # for disk_var.sh
538 lange 4297 # use the last disk_var during update if available
539     [ -f /var/lib/fai/disk_var.sh ] && cp -p /var/lib/fai/disk_var.sh $LOGDIR
540 lange 2671
541 lange 3903 defnop wait_for_jobs
542 lange 2671 save_dmesg
543    
544     task mirror
545     task debconf
546     task updatebase
547     task instsoft
548     task configure
549     date
550 lange 3791 echo "The $FAI_ACTION took $[$(cut -d . -f 1 /proc/uptime)-$start_seconds] seconds."
551 lange 2671
552     rm -f $stamp
553     # save again, because new messages could be created
554     save_dmesg
555     task savelog
556    
557 lange 4921 # umount config space if accessed via nfs
558     echo $FAI_CONFIG_SRC | grep -q ^nfs://
559     if [ $? -eq 0 ]; then
560     grep -q " $FAI nfs" /etc/mtab && umount $FAI
561     fi
562    
563 lange 2671 if [ -f $stamp ]; then
564     echo "Error while executing commands in subshell."
565 lange 4709 echo -n "$stamp was not removed. PID of running process: "
566     cat $stamp
567 lange 4085 sendmon "TASKERROR softupdate 21"
568 lange 2671 die "Please look at the log files in $LOGDIR for errors."
569     fi
570     }
571     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
572    
573 lange 2301 catnc() {
574     # cat but no comment lines
575 lange 2403 egrep -v "^#" $@
576 lange 2301 }
577     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.5