Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 70540 Details for
Bug 108945
openvpn init script broken
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
openvpn init for all baselayouts
openvpn (text/plain), 1.76 KB, created by
Roy Marples (RETIRED)
on 2005-10-13 03:07:47 UTC
(
hide
)
Description:
openvpn init for all baselayouts
Filename:
MIME Type:
Creator:
Roy Marples (RETIRED)
Created:
2005-10-13 03:07:47 UTC
Size:
1.76 KB
patch
obsolete
>#!/sbin/runscript > >VPNDIR="/etc/openvpn" > >depend() { > need net >} > >checktundevice() { > if [[ -h /dev/net/tun && -c /dev/misc/net/tun ]]; then > ebegin "Detected broken /dev/net/tun symlink, fixing..." > rm -f /dev/net/tun > ln -s /dev/misc/net/tun /dev/net/tun > eend $? > fi >} > >start() { > checktundevice || return 1 > local vpn vpnd onestarted=false vpns > > for vpn in $(cd "${VPNDIR}"; ls 2>/dev/null); do > [[ -d "${VPNDIR}/${vpn}" ]] && vpns="${vpns} ${vpn}" > done > > if [[ -z ${vpns} ]]; then > eerror "No VPNs have been configured in /etc/openvpn" > eerror "Ensure that you create a directory there with the name of your" > eerror "VPN and that it contains a configuration file called local.conf" > return 1 > fi > > for vpn in ${vpns}; do > vpnd="${VPNDIR}/${vpn}" > if [[ ! -e "${vpnd}/local.conf" ]]; then > ewarn "Expected ${vpnd} to be a directory containing a local.conf" > continue > fi > if [[ -s "${vpnd}/onlinecheck" ]]; then > if ping -c 3 $(head -n 1 "${vpnd}/onlinecheck" ) &>/dev/null ; then > einfo "Connection ${VPN} already online. Skipping..." > continue > fi > fi > > local pidfile="/var/run/openvpn-${vpn}.pid" > ebegin "Starting openvpn for ${vpn}" > start-stop-daemon --start --exec /usr/sbin/openvpn \ > --pidfile "${pidfile}" \ > -- --config "${vpnd}/local.conf" --writepid "${pidfile}" \ > --daemon --cd "${vpnd}" > eend $? "Check your logs to see why startup failed" && onestarted=true > done > > ${onestarted} >} > >stop() { > local vpn pidfile allstopped=true > for pidfile in $(cd /var/run; ls openvpn-*.pid 2>/dev/null); do > vpn="${pidfile##openvpn-}" > vpn="${vpn%%.pid}" > ebegin "Stopping openvpn for ${vpn}" > start-stop-daemon --stop -exec /usr/sbin/openvpn \ > --pidfile "/var/run/${pidfile}" > eend $? || allstopped=false > done > > ${allstopped} >} > ># vim: ts=4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 108945
: 70540 |
70547