- fix exit/return mixup
[myplc.git] / plc.d / bootcd
1 #!/bin/bash
2 #
3 # priority: 1000
4 #
5 # Rebuild the Boot CD
6 #
7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
9 #
10 # $Id: bootcd,v 1.3 2006/06/23 20:29:22 mlhuang Exp $
11 #
12
13 # Source function library and configuration
14 . /etc/plc.d/functions
15 . /etc/planetlab/plc_config
16
17 # Be verbose
18 set -x
19
20 case "$1" in
21     start)
22         if [ "$PLC_BOOT_ENABLED" != "1" -a \
23              "$PLC_WWW_ENABLED" != "1" ] ; then
24             exit 0
25         fi
26
27         MESSAGE=$"Rebuilding Boot CD"
28         dialog "$MESSAGE"
29
30         # Customize the Boot CD
31         pushd /var/www/html/download
32         /usr/share/bootcd/build.sh
33         check
34         popd
35
36         result "$MESSAGE"
37         ;;
38 esac
39
40 exit $ERRORS