aboutsummaryrefslogtreecommitdiff
path: root/net/openfortivpn
diff options
context:
space:
mode:
authorAaron Goodman <aaronjg@stanford.edu>2020-07-20 10:46:48 -0400
committerAaron Goodman <aaronjg@stanford.edu>2020-07-28 23:06:09 -0400
commitd8b71f45a8da8226ce1b801c37e88fefa9d93f36 (patch)
tree9a8709c0ea22b826e00f47a4629889df99d8326a /net/openfortivpn
parent7f109ec59f304b7a73bf3ea5ff54f7ae54aed5b7 (diff)
openfortivpn: don't report error if symlink already exists
If two openfortivpn scripts are started at the same time, a race condition can occur where the conditional evaluates to true, but the symlink exists by the time the other script tries to create it Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
Diffstat (limited to 'net/openfortivpn')
-rwxr-xr-xnet/openfortivpn/files/openfortivpn.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/openfortivpn/files/openfortivpn.sh b/net/openfortivpn/files/openfortivpn.sh
index b50ba016a..5599f3150 100755
--- a/net/openfortivpn/files/openfortivpn.sh
+++ b/net/openfortivpn/files/openfortivpn.sh
@@ -104,7 +104,7 @@ proto_openfortivpn_setup() {
[ -n "$username" ] && append_args -u "$username"
[ -n "$password" ] && {
umask 077
- mkdir -p /var/etc
+ mkdir -p '/var/etc/openfortivpn'
pwfile="/var/etc/openfortivpn/$config.passwd"
echo "$password" > "$pwfile"
}
@@ -112,7 +112,7 @@ proto_openfortivpn_setup() {
[ -n "$local_ip" ] || local_ip=192.0.2.1
[ -e '/etc/ppp/peers' ] || mkdir -p '/etc/ppp/peers'
[ -e '/etc/ppp/peers/openfortivpn' ] || {
- ln -s -T '/var/etc/openfortivpn/peers' '/etc/ppp/peers/openfortivpn'
+ ln -s -T '/var/etc/openfortivpn/peers' '/etc/ppp/peers/openfortivpn' 2> /dev/null
mkdir -p '/var/etc/openfortivpn/peers'
}