3fd204a8e5154308b970599cf162db5f7c5fd182
[myplc.git] / plc.d / bootmanager
1 #!/bin/bash
2 #
3 # priority: 1100
4 #
5 # Rebuild the Boot Manager
6 #
7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
9 #
10 # $Id: bootmanager,v 1.2 2006/04/25 21:18:19 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             return 0
25         fi
26
27         MESSAGE=$"Rebuilding Boot Manager"
28         dialog "$MESSAGE"
29
30         # Customize the Boot Manager
31         pushd /var/www/html/boot
32         /usr/share/bootmanager/build.sh
33         check
34         popd
35
36         result "$MESSAGE"
37         ;;
38 esac
39
40 exit $ERRORS