blob: a1864fd770cd1e8c1601099c57dd06bb20ce9442 (
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
31
32
33
34
35
36
37
|
#!/bin/bash -e
prefix=@prefix@
exec_prefix=@exec_prefix@
sysconfdir=@sysconfdir@
sbindir=@sbindir@
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
systemctl enable vyos-router.service >/dev/null
# 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
# commit hooks
mkdir -p /etc/commit/pre-hooks.d
mkdir -p /etc/commit/post-hooks.d
# create symlink for post commit hook
ln -sf /opt/vyatta/sbin/vyatta-log-commit.pl /etc/commit/post-hooks.d/10vyatta-log-commit.pl
# User pre/post-commit hook executors
ln -sf /opt/vyatta/sbin/vyos-user-precommit-hooks.sh /etc/commit/pre-hooks.d/99vyos-user-precommit-hooks
ln -sf /opt/vyatta/sbin/vyos-user-postcommit-hooks.sh /etc/commit/post-hooks.d/99vyos-user-postcommit-hooks
|