fix resolv.conf issue on plc
[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$
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 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
35         dirlist="" 
36         for i in `ls`; do 
37                 if [ -d $i ]; then 
38                         dirlist="$dirlist $i" 
39                 fi
40         done
41         for dir in $dirlist ; do 
42                 echo -n " $dir"
43                 /usr/share/bootmanager/build.sh $dir
44                 check
45         done
46         popd
47
48         result "$MESSAGE"
49         ;;
50 esac
51
52 exit $ERRORS