summaryrefslogtreecommitdiff
path: root/debian/vyatta-cfg.postinst.in
diff options
context:
space:
mode:
Diffstat (limited to 'debian/vyatta-cfg.postinst.in')
-rw-r--r--debian/vyatta-cfg.postinst.in25
1 files changed, 23 insertions, 2 deletions
diff --git a/debian/vyatta-cfg.postinst.in b/debian/vyatta-cfg.postinst.in
index 48b889d..c307803 100644
--- a/debian/vyatta-cfg.postinst.in
+++ b/debian/vyatta-cfg.postinst.in
@@ -1,10 +1,24 @@
#!/bin/bash
prefix=@prefix@
+exec_prefix=@exec_prefix@
sysconfdir=@sysconfdir@
+sbindir=@sbindir@
-mkdir -m 0775 -p $sysconfdir/config $prefix/config
-chgrp vyattacfg $sysconfdir/config $prefix/config 2>/dev/null
+if [ "$1" = "configure" ]; then
+ ldconfig
+fi
+
+for dir in $sysconfdir/config $prefix/config; do
+ if [ -d "$dir" ]; then
+ # already exists
+ chmod 2775 $dir
+ else
+ # create it
+ mkdir -m 2775 -p $dir
+ fi
+ chgrp vyattacfg $dir 2>/dev/null
+done
update-rc.d vyatta-router defaults 90 >/dev/null
@@ -16,3 +30,10 @@ if [ "$sysconfdir" != "/etc" ]; then
touch /etc/$conf
done
fi
+
+# capability stuff
+for bin in my_cli_bin my_cli_shell_api; do
+ touch -ac $sbindir/$bin
+ setcap cap_sys_admin=pe $sbindir/$bin
+done
+