summaryrefslogtreecommitdiff
path: root/debian/vyatta-cfg.postinst.in
blob: 96d66bec826832210b9ad9483d17ee4b0d18c8c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

prefix=@prefix@
sysconfdir=@sysconfdir@

# add group for configuration, if not already present:
grep '^vyattacfg:' /etc/group >&/dev/null ||
addgroup --system vyattacfg

mkdir -m 0775 -p $sysconfdir/config $prefix/config
chgrp vyattacfg $sysconfdir/config $prefix/config 2>/dev/null

# fix permissions of config file during upgrade
if [ ! -d $sysconfdir/config/config.boot ]; then
    chgrp vyattacfg 
    chmod 0664 $sysconfdir/config/config.boot
fi

update-rc.d vyatta-ofr defaults 90 >/dev/null
# do we want to start vyatta-ofr here in postinst?

if [ "$sysconfdir" != "/etc" ]; then
  # remove the config files and replace with blank ones
  for conf in dhcp3/dhclient.conf 
  do
    [ -f /etc/$conf ] && mv -f /etc/$conf /etc/$conf.vyatta-save
    touch /etc/$conf
  done
fi