Browse Source

openfortivpn: avoid flash writes on pppd script

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
lilik-openwrt-22.03
Aaron Goodman 5 years ago
parent
commit
36f77a171d
1 changed files with 11 additions and 6 deletions
  1. +11
    -6
      net/openfortivpn/files/openfortivpn.sh

+ 11
- 6
net/openfortivpn/files/openfortivpn.sh View File

@ -92,13 +92,18 @@ proto_openfortivpn_setup() {
[ -n "$password" ] && {
umask 077
mkdir -p /var/etc
pwfile="/var/etc/openfortivpn-$config.passwd"
pwfile="/var/etc/openfortivpn/$config.passwd"
echo "$password" > "$pwfile"
}
[ -n "$local_ip" ] || local_ip=192.0.2.1
mkdir -p '/etc/ppp/peers'
callfile="/etc/ppp/peers/$config"
[ -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'
mkdir -p '/var/etc/openfortivpn/peers'
}
callfile="/var/etc/openfortivpn/peers/$config"
echo "115200
:$local_ip
noipdefault
@ -114,7 +119,7 @@ lcp-max-configure 40
ip-up-script /lib/netifd/ppp-up
ip-down-script /lib/netifd/ppp-down
mru 1354" > $callfile
append_args "--pppd-call=$config"
append_args "--pppd-call=openfortivpn/$config"
proto_export INTERFACE="$ifname"
logger -t openfortivpn "$config: executing 'openfortivpn $cmdline'"
@ -127,8 +132,8 @@ mru 1354" > $callfile
proto_openfortivpn_teardown() {
local config="$1"
pwfile="/var/etc/openfortivpn-$config.passwd"
callfile="/etc/ppp/peers/$config"
pwfile="/var/etc/openfortivpn/$config.passwd"
callfile="/var/etc/openfortivpn/peers/$config"
rm -f $pwfile
rm -f $callfile


Loading…
Cancel
Save