Statistics
| Branch: | Tag: | Revision:

root / hooks / group-modify-pre.d / snf-network @ d2b16e51

History | View | Annotate | Download (400 Bytes)

1
#!/bin/bash
2

    
3
source /etc/default/snf-network
4

    
5
source $CONF
6

    
7
GROUP=$GANETI_GROUP_NAME
8
ACTION=$GANETI_GROUP_NETWORK_ACTION
9
NETWORK=$GANETI_GROUP_NETWORK_NAME
10
MODE=$GANETI_GROUP_NETWORK_MODE
11
LINK=$GANETI_GROUP_NETWORK_LINK
12

    
13
GROUPMAPFILE=$SHAREDDIR/mappings/$NETWORK-$GROUP
14

    
15

    
16
if [ -z "$ACTION" ]; then
17
  exit 0
18
fi
19

    
20
if [ "$ACTION" == "add" ]; then
21
  cat > $GROUPMAPFILE <<EOF
22
MODE=$MODE
23
LINK=$LINK
24
EOF
25
fi