From patchwork Mon Mar 28 17:51:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stijn Tintel X-Patchwork-Id: 602531 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qYhRN0KG1z9t0s for ; Tue, 29 Mar 2016 04:56:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=linux-ipv6.be header.i=@linux-ipv6.be header.b=R7Lcq7SW; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 86DA9B9122E; Mon, 28 Mar 2016 19:52:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Mon, 28 Mar 2016 19:52:18 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 0F107B911D0 for ; Mon, 28 Mar 2016 19:52:03 +0200 (CEST) X-policyd-weight: using cached result; rate: -6.1 Received: from mail.tintel.eu (mail.tintel.eu [62.213.201.86]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 28 Mar 2016 19:51:58 +0200 (CEST) Received: from localhost (localhost [IPv6:::1]) by mail.tintel.eu (Postfix) with ESMTP id 16D9C2A41F6 for ; Mon, 28 Mar 2016 19:51:57 +0200 (CEST) Received: from mail.tintel.eu ([IPv6:::1]) by localhost (mail.tintel.eu [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id gH57dszMPeIc for ; Mon, 28 Mar 2016 19:51:56 +0200 (CEST) Received: from localhost (localhost [IPv6:::1]) by mail.tintel.eu (Postfix) with ESMTP id 92CA92A41F5 for ; Mon, 28 Mar 2016 19:51:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.9.2 mail.tintel.eu 92CA92A41F5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-ipv6.be; s=502B7754-045F-11E5-BBC5-64595FD46BE8; t=1459187516; bh=H9OM6/uPGyOXgnsy2hDX924+CE+FueaSiJluw02CDFg=; h=From:To:Subject:Date:Message-Id; b=R7Lcq7SW8EOW3NaduN5ngyil869OsvtGovcU5Jz7lq4IL5a271Z2R8v1Ka0HnjGtB 1AF2vGXxdY9T5dg02cOxdeYyvByq5oOn2rht9y/MOvR7F86z/mauwgOIeC5PA1Bt6T qtLp/M5UXqVBlKsM8VQPWzrhbMLCSIG/vm2Ka8gQ= X-Virus-Scanned: amavisd-new at mail.tintel.eu Received: from mail.tintel.eu ([IPv6:::1]) by localhost (mail.tintel.eu [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id PnPbuvsG8MlG for ; Mon, 28 Mar 2016 19:51:56 +0200 (CEST) Received: from store.st-esk.be.tintel.eu (unknown [IPv6:2a02:1811:406:dc00:1e6f:65ff:fef8:7a3b]) by mail.tintel.eu (Postfix) with SMTP id 6ABBB2A41F6 for ; Mon, 28 Mar 2016 19:51:55 +0200 (CEST) Received: by store.st-esk.be.tintel.eu (sSMTP sendmail emulation); Mon, 28 Mar 2016 19:51:56 +0200 From: Stijn Tintel To: openwrt-devel@lists.openwrt.org Date: Mon, 28 Mar 2016 19:51:44 +0200 Message-Id: <1459187509-12124-6-git-send-email-stijn@linux-ipv6.be> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1459187509-12124-1-git-send-email-stijn@linux-ipv6.be> References: <1459187509-12124-1-git-send-email-stijn@linux-ipv6.be> Subject: [OpenWrt-Devel] [RFC PATCH 05/10] openvpn: generate config in /tmp/etc X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Stijn Tintel --- package/network/services/openvpn/files/openvpn.init | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init index 5396d0b..7ee756d 100644 --- a/package/network/services/openvpn/files/openvpn.init +++ b/package/network/services/openvpn/files/openvpn.init @@ -24,7 +24,7 @@ append_param() { *_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;; *_*) v=${v%%_*}-${v#*_} ;; esac - echo -n "$v" >> "/var/etc/openvpn-$s.conf" + echo -n "$v" >> "/tmp/etc/openvpn-$s.conf" return 0 } @@ -32,7 +32,7 @@ append_bools() { local p; local v; local s="$1"; shift for p in $*; do config_get_bool v "$s" "$p" - [ "$v" = 1 ] && append_param "$s" "$p" && echo >> "/var/etc/openvpn-$s.conf" + [ "$v" = 1 ] && append_param "$s" "$p" && echo >> "/tmp/etc/openvpn-$s.conf" done } @@ -42,7 +42,7 @@ append_params() { config_get v "$s" "$p" IFS="$LIST_SEP" for v in $v; do - [ -n "$v" ] && append_param "$s" "$p" && echo " $v" >> "/var/etc/openvpn-$s.conf" + [ -n "$v" ] && append_param "$s" "$p" && echo " $v" >> "/tmp/etc/openvpn-$s.conf" done unset IFS done @@ -89,8 +89,8 @@ start_instance() { return fi - [ ! -d "/var/etc" ] && mkdir -p "/var/etc" - [ -f "/var/etc/openvpn-$s.conf" ] && rm "/var/etc/openvpn-$s.conf" + [ ! -d "/tmp/etc" ] && mkdir -p "/tmp/etc" + [ -f "/tmp/etc/openvpn-$s.conf" ] && rm "/tmp/etc/openvpn-$s.conf" # append flags append_bools "$s" \ @@ -127,7 +127,7 @@ start_instance() { verify_x509_name x509_username_field \ ifconfig_ipv6 route_ipv6 server_ipv6 ifconfig_ipv6_pool ifconfig_ipv6_push iroute_ipv6 - openvpn_add_instance "$s" "/var/etc" "openvpn-$s.conf" + openvpn_add_instance "$s" "/tmp/etc" "openvpn-$s.conf" } start_service() {