Fix for Alpine Linux
- Fix IPsec service on Alpine Linux. Fixes #1123. - Clean up unneeded /etc/rc.local code for this OS.
This commit is contained in:
parent
018a9eab1f
commit
a891b7613c
@ -170,6 +170,7 @@ get_libreswan() {
|
||||
install_libreswan() {
|
||||
bigecho "Compiling and installing Libreswan, please wait..."
|
||||
cd "libreswan-$SWAN_VER" || exit 1
|
||||
sed -i '1c\#!/sbin/openrc-run' /etc/init.d/ipsec
|
||||
service ipsec stop >/dev/null 2>&1
|
||||
sed -i '28s/stdlib\.h/sys\/types.h/' include/fd.h
|
||||
cat > Makefile.inc.local <<'EOF'
|
||||
@ -255,6 +256,7 @@ update_config() {
|
||||
restart_ipsec() {
|
||||
bigecho "Restarting IPsec service..."
|
||||
mkdir -p /run/pluto
|
||||
sed -i '1c\#!/sbin/openrc-run' /etc/init.d/ipsec
|
||||
service ipsec restart >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
@ -475,25 +475,10 @@ exit 0
|
||||
EOF
|
||||
chmod +x /etc/network/if-pre-up.d/iptablesload
|
||||
|
||||
sed -i '1c\#!/sbin/openrc-run' /etc/init.d/ipsec
|
||||
for svc in fail2ban ipsec xl2tpd; do
|
||||
rc-update add "$svc" >/dev/null
|
||||
rc-update add "$svc" default >/dev/null
|
||||
done
|
||||
|
||||
if ! grep -qs "hwdsl2 VPN script" /etc/rc.local; then
|
||||
if [ -f /etc/rc.local ]; then
|
||||
conf_bk "/etc/rc.local"
|
||||
else
|
||||
echo '#!/bin/sh' > /etc/rc.local
|
||||
fi
|
||||
cat >> /etc/rc.local <<'EOF'
|
||||
|
||||
# Added by hwdsl2 VPN script
|
||||
(sleep 15
|
||||
service ipsec restart
|
||||
service xl2tpd restart
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward)&
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
start_services() {
|
||||
|
Loading…
Reference in New Issue
Block a user