summaryrefslogtreecommitdiff
path: root/debian/vyatta-cfg-system.postinst.in
diff options
context:
space:
mode:
Diffstat (limited to 'debian/vyatta-cfg-system.postinst.in')
-rw-r--r--debian/vyatta-cfg-system.postinst.in25
1 files changed, 21 insertions, 4 deletions
diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in
index 2c9f0fbf..eae046f7 100644
--- a/debian/vyatta-cfg-system.postinst.in
+++ b/debian/vyatta-cfg-system.postinst.in
@@ -24,7 +24,7 @@ if [ "$sysconfdir" != "/etc" ]; then
quagga/bgpd.conf quagga/ospfd.conf quagga/ospf6d.conf \
quagga/ripd.conf quagga/ripngd.conf quagga/isisd.conf \
snmp/snmpd.conf snmp/snmptrapd.conf keepalived/keepalived.conf \
- ipvsadm.rules default/ipvsadm
+ ipvsadm.rules default/ipvsadm resolv.conf
do
[ -f /etc/$conf ] && mv -f /etc/$conf /etc/$conf.vyatta-save
touch /etc/$conf
@@ -39,9 +39,19 @@ if [ "$sysconfdir" != "/etc" ]; then
# sudoers
[ -f /etc/sudoers ] && cp -pf /etc/sudoers /etc/sudoers.vyatta-save
- if ! grep -q '%quaggavty ALL=NOPASSWD: ALL' /etc/sudoers; then
- echo -e "\n%quaggavty ALL=NOPASSWD: ALL" >> /etc/sudoers
+
+ # for "admin" level (FIXME)
+ sed -i 's/^# %sudo ALL=NOPASSWD: ALL/%sudo ALL=NOPASSWD: ALL/' /etc/sudoers
+ if ! grep -q '^%sudo ALL=NOPASSWD: ALL' /etc/sudoers; then
+ echo -e "\n%sudo ALL=NOPASSWD: ALL" >> /etc/sudoers
fi
+
+ # for "users" level
+ if ! grep -q "^%users ALL=NOPASSWD: ${bindir}/sudo-users/" /etc/sudoers; then
+ echo -e "\n%users ALL=NOPASSWD: ${bindir}/sudo-users/" >> /etc/sudoers
+ fi
+
+ # keep env vars
echo "Defaults env_keep+=VYATTA_*" >> /etc/sudoers
# ssh v1. remove the empty key file
@@ -51,7 +61,11 @@ if [ "$sysconfdir" != "/etc" ]; then
rm /etc/logrotate.d/*.vyatta-save >& /dev/null
# quagga/daemons
- sed 's/=no/=yes/' /etc/quagga/daemons.vyatta-save > /etc/quagga/daemons
+ sed 's/zebra=no/zebra=yes/' /etc/quagga/daemons.vyatta-save > /etc/quagga/daemons
+ sed -i 's/bgpd=no/bgpd=yes/' /etc/quagga/daemons
+ sed -i 's/ospfd=no/ospfd=yes/' /etc/quagga/daemons
+ sed -i 's/ripd=no/ripd=yes/' /etc/quagga/daemons
+
echo "log syslog warnings" >> /etc/quagga/bgpd.conf
echo "log syslog warnings" >> /etc/quagga/isisd.conf
echo "log syslog warnings" >> /etc/quagga/ospf6d.conf
@@ -59,6 +73,9 @@ if [ "$sysconfdir" != "/etc" ]; then
echo "log syslog warnings" >> /etc/quagga/ripd.conf
echo "log syslog warnings" >> /etc/quagga/ripngd.conf
echo "log syslog warnings" >> /etc/quagga/zebra.conf
+
+ # add temporary version
+ echo "Version : eureka (beta)" > $sysconfdir/version
fi
# update crontab for logrotate