reguire gnupg1 on f>=31; sense the system to use gpg1 when installed
[bootmanager.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
11 # Source function library and configuration
12 . /etc/plc.d/functions
13 . /etc/planetlab/plc_config
14
15 # Be verbose
16 set -x
17
18 case "$1" in
19     start)
20         if [ "$PLC_BOOT_ENABLED" != "1" -a \
21              "$PLC_WWW_ENABLED" != "1" ] ; then
22             exit 0
23         fi
24
25         shopt -s nullglob
26         for topdir in /usr/share/bootmanager/* ; do
27             [ -d "$topdir" ] || continue
28             deployment=$(basename $topdir)
29             if [ "$deployment" = "regular" ] ; then
30                 action $"Rebuilding Boot Manager"  $topdir/build.sh regular
31                 check
32             elif [ -x $topdir/build.sh ] ; then
33                 action $"Rebuilding Boot Manager for deployment $deployment" $topdir/build.sh $deployment
34                 check
35             elif [ "$deployment" == "source" ] ; then
36                 action $"Ignoring obsolete dir, please cleanup $topdir"
37             else
38                 action $"WARNING: missing build.sh script in $topdir"
39             fi
40         done
41
42         result "$MESSAGE"
43         ;;
44 esac
45
46 exit $ERRORS