1
0
mirror of synced 2024-11-24 22:06:07 +03:00

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:
hwdsl2 2022-03-12 23:55:32 -06:00
parent 018a9eab1f
commit a891b7613c
2 changed files with 4 additions and 17 deletions

View File

@ -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
}

View File

@ -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() {