strongswan: fix swanctl restart without /var/ipsec

'/etc/init.d/swanctl restart' does not start charon if /var/ipsec does
not exist, e.g. after boot with the service disabled. stop_service calls
file_reset, which truncates /var/ipsec/strongswan.conf with a redirect.
In ash a failing redirect on the special builtin ':' terminates the
shell, so the init script exits before start_service runs.

Create the parent directory in file_reset.

Signed-off-by: Alexander Wilhelm <alexander.wilhelm@westermo.com>
This commit is contained in:
Alexander Wilhelm authored and Florian Eckert committed 2026-11-24 15:45:36 +01:00
1 parent f35b71096c
commit c454ac15bd
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=strongswan
PKG_VERSION:=6.0.7
PKG_RELEASE:=13
PKG_RELEASE:=14
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://download.strongswan.org/ https://download2.strongswan.org/
+1
View File
@@ -58,6 +58,7 @@ seconds2time() {
}
file_reset() {
mkdir -p "${1%/*}"
: > "$1"
}