/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

* network-hooks.d: New directory.
* network-hooks.d/bridge: New example hook.
* network-hooks.d/bridge.conf: Config file for bridge example hook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
# Make directories
74
74
install --directory --mode=u=rwx,go=rx "${DESTDIR}${CONFDIR}" \
75
 
        "${DESTDIR}${MANDOSDIR}" "${DESTDIR}${HOOKDIR}"
 
75
        "${DESTDIR}${MANDOSDIR}"
76
76
install --owner=${mandos_user} --group=${mandos_group} --directory \
77
77
    --mode=u=rwx "${DESTDIR}${PLUGINDIR}"
78
78
 
111
111
for hook in /etc/mandos/network-hooks.d/*; do
112
112
    case "`basename \"$hook\"`" in
113
113
        "*") continue ;;
114
 
        *[!A-Za-z0-9_.-]*) continue ;;
 
114
        *[!A-Za-z0-9_-]*) continue ;;
115
115
        *) test -d "$hook" || copy_exec "$hook" "${HOOKDIR}" ;;
116
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
 
117
    # Copy any files needed by the network hook
 
118
    MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=files \
 
119
        "$hook" files | while read file target; do
 
120
        if [ -z "${target}" ]; then
 
121
            copy_exec "$file"
 
122
        else
 
123
            copy_exec "$file" "$target"
 
124
        fi
 
125
    done
135
126
done
136
127
 
137
128
# GPGME needs /usr/bin/gpg