/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to initramfs-tools-hook

  • Committer: Björn Påhlsson
  • Date: 2011-11-28 07:39:48 UTC
  • mfrom: (505.3.16 client-network-hooks)
  • mto: This revision was merged to the branch mainline in revision 525.
  • Revision ID: belorn@recompile.se-20111128073948-xd69945uliwv2y61
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
CONFDIR="/conf/conf.d/mandos"
69
69
MANDOSDIR="/lib/mandos"
70
70
PLUGINDIR="${MANDOSDIR}/plugins.d"
 
71
HOOKDIR="${MANDOSDIR}/network-hooks.d"
71
72
 
72
73
# Make directories
73
74
install --directory --mode=u=rwx,go=rx "${DESTDIR}${CONFDIR}" \
74
 
        "${DESTDIR}${MANDOSDIR}"
 
75
        "${DESTDIR}${MANDOSDIR}" "${DESTDIR}${HOOKDIR}"
75
76
install --owner=${mandos_user} --group=${mandos_group} --directory \
76
77
    --mode=u=rwx "${DESTDIR}${PLUGINDIR}"
77
78
 
106
107
    esac
107
108
done
108
109
 
 
110
# Copy network hooks
 
111
for hook in /etc/mandos/network-hooks.d/*; do
 
112
    case "`basename \"$hook\"`" in
 
113
        "*") continue ;;
 
114
        *[!A-Za-z0-9_.-]*) continue ;;
 
115
        *) test -d "$hook" || copy_exec "$hook" "${HOOKDIR}" ;;
 
116
    esac
 
117
    if [ -x "$hook" ]; then
 
118
        # Copy any files needed by the network hook
 
119
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=files \
 
120
            VERBOSITY=0 "$hook" files | while read file target; do
 
121
            if [ -z "${target}" ]; then
 
122
                copy_exec "$file"
 
123
            else
 
124
                copy_exec "$file" "$target"
 
125
            fi
 
126
        done
 
127
        # Copy and load any modules needed by the network hook
 
128
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=modules \
 
129
            VERBOSITY=0 "$hook" modules | while read module; do
 
130
            if [ -z "${target}" ]; then
 
131
                force_load "$module"
 
132
            fi
 
133
        done
 
134
    fi
 
135
done
 
136
 
109
137
# GPGME needs /usr/bin/gpg
110
138
if [ ! -e "${DESTDIR}/usr/bin/gpg" \
111
139
    -a -n "`ls \"${DESTDIR}\"/usr/lib/libgpgme.so* \
131
159
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
132
160
fi
133
161
 
134
 
# Key files 
 
162
# Key files
135
163
for file in "$keydir"/*; do
136
164
    if [ -d "$file" ]; then
137
165
        continue