File: swan-install

package info (click to toggle)
libreswan 5.2-2.4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 81,656 kB
  • sloc: ansic: 129,988; sh: 32,018; xml: 20,646; python: 10,303; makefile: 3,022; javascript: 1,506; sed: 574; yacc: 511; perl: 264; awk: 52
file content (43 lines) | stat: -rwxr-xr-x 926 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
43
#!/bin/sh

# we run with -x so : works instead of echo for output (not logging)
set -eux

if [ -r LIBRESWAN-OPENPGP-KEY.txt ]; then
    cat <<EOF

$PWD is a top-level source directory.
Not CDing to /source

EOF
else
    cd /source
fi

if [ -f /usr/libexec/ipsec/pluto ]; then
    : ABORT: existing pluto found at /usr/libexec/ipsec/pluto
    exit 1
fi

pidof pluto >/dev/null && ipsec setup stop 2> /dev/null

targets="install-base module_install"
make "$@" $targets

# ensure selinux bits
restorecon /usr/local/sbin -Rv
restorecon /usr/local/libexec/ipsec -Rv

# disable autostarting via service or systemd
if [ -x /usr/bin/systemctl -o \
    -x /usr/sbin/systemctl -o \
    -x /sbin/systemctl ]; then
    sed -i "s/Restart=always/Restart=no/" \
	/lib/systemd/system/ipsec.service
    systemctl disable ipsec.service
    systemctl daemon-reload
else
    service ipsec disable
fi

echo "$0 finished on $(hostname) at $(date)"