Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
f4942899
Commit
f4942899
authored
Feb 16, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces: reshape the ppp-linkdown script #1403
parent
8ebc1223
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
23 deletions
+45
-23
ppp-linkdown
src/sbin/ppp-linkdown
+45
-23
No files found.
src/sbin/ppp-linkdown
View file @
f4942899
#!/bin/sh
IF
=
"
${
1
}
"
LOCAL_IP
=
"
${
3
}
"
AF
=
"
${
2
}
"
IP
=
"
${
3
}
"
GW
=
if
[
-f
/tmp/
${
IF
}
up
]
&&
[
-f
/conf/
${
IF
}
.log
]
;
then
seconds
=
$((
`
date
-j
+%s
`
-
`
/usr/bin/stat
-f
%m /tmp/
${
IF
}
up
`
))
/usr/local/sbin/ppp-log-uptime.sh
$seconds
${
IF
}
&
fi
/usr/local/etc/rc.kill_states
${
IF
}
${
IP
}
/usr/local/etc/rc.kill_states
${
IF
}
${
LOCAL_IP
}
if
[
"
${
AF
}
"
=
"inet"
]
;
then
if
[
-f
/tmp/
${
IF
}
up
]
&&
[
-f
/conf/
${
IF
}
.log
]
;
then
seconds
=
$((
`
date
-j
+%s
`
-
`
/usr/bin/stat
-f
%m /tmp/
${
IF
}
up
`
))
/usr/local/sbin/ppp-log-uptime.sh
$seconds
${
IF
}
&
fi
if
[
-s
"/tmp/
${
IF
}
_defaultgw"
]
;
then
GW
=
`
head
-n
1 /tmp/
${
IF
}
_defaultgw
`
[
-n
"
${
GW
}
"
]
\
&&
/sbin/route delete default
${
GW
}
fi
# delete the node just in case mpd cannot do that
/usr/sbin/ngctl shutdown
${
IF
}
:
if
[
-f
"/var/etc/nameserver_
${
IF
}
"
]
;
then
# Remove old entries
for
nameserver
in
`
cat
/var/etc/nameserver_
${
IF
}
`
;
do
/sbin/route delete
${
nameserver
}
>
/dev/null 2>&1
done
/bin/rm
-f
/var/etc/nameserver_
${
IF
}
if
[
-s
"/tmp/
${
IF
}
_defaultgw"
]
;
then
GW
=
$(
head
-n
1 /tmp/
${
IF
}
_defaultgw
)
fi
if
[
-n
"
${
GW
}
"
]
;
then
/sbin/route delete -
${
AF
}
default
${
GW
}
fi
if
[
-f
"/var/etc/nameserver_
${
IF
}
"
]
;
then
# Remove old entries
for
nameserver
in
$(
cat
/var/etc/nameserver_
${
IF
}
)
;
do
/sbin/route delete
${
nameserver
}
>
/dev/null 2>&1
done
/bin/rm
-f
/var/etc/nameserver_
${
IF
}
fi
# Do not remove gateway used during filter reload.
/bin/rm
-f
/tmp/
${
IF
}
_router /tmp/
${
IF
}
up /tmp/
${
IF
}
_ip
elif
[
"
${
AF
}
"
=
"inet6"
]
;
then
if
[
-s
"/tmp/
${
IF
}
_defaultgwv6"
]
;
then
GW
=
$(
head
-n
1 /tmp/
${
IF
}
_defaultgwv6
)
fi
if
[
-n
"
${
GW
}
"
]
;
then
/sbin/route delete -
${
AF
}
default
${
GW
}
fi
if
[
-f
"/var/etc/nameserver_v6
${
IF
}
"
]
;
then
# Remove old entries
for
nameserver
in
$(
cat
/var/etc/nameserver_v6
${
IF
}
)
;
do
/sbin/route delete
${
nameserver
}
>
/dev/null 2>&1
done
/bin/rm
-f
/var/etc/nameserver_v6
${
IF
}
fi
# Do not remove gateway used during filter reload.
/bin/rm
-f
/tmp/
${
IF
}
_routerv6 /tmp/
${
IF
}
upv6 /tmp/
${
IF
}
_ipv6
fi
# Do not remove gateway used during filter reload.
/bin/rm
-f
/tmp/
${
IF
}
_router
/bin/rm
-f
/tmp/
${
IF
}
up
/bin/rm
-f
/tmp/
${
IF
}
_ip
/usr/local/opnsense/service/configd_ctl.py dns reload
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment