summaryrefslogtreecommitdiff
path: root/network/strongswan/doinst.sh
blob: a88995c5ed38ce4491303dce6c5397d0d54f342a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

config() {
    NEW="$1"
    OLD="${1%.new}"
    if [ ! -r $OLD ];
    then
        # If there's no config file by that name, mv it over:
        mv $NEW $OLD
    elif [ "$(md5sum <$OLD)" = "$(md5sum <$NEW)" ];
    then
        # toss the redundant copy
        rm $NEW
    fi
    # Otherwise, we leave the .new copy for the admin to consider...
}

# doinst.sh reads the list of files from ./install/conffiles at install time.
# ./install/conffiles was generated by strongswan.SlackBuild
for cf in $(cat install/conffiles)
do
    config $cf.new
done