/[gentoo-x86]/net-misc/networkmanager/files/init.d.NetworkManager
Gentoo

Contents of /net-misc/networkmanager/files/init.d.NetworkManager

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Mon Jan 28 07:05:05 2013 UTC (22 months, 2 weeks ago) by tetromino
Branch: MAIN
CVS Tags: HEAD
Add 0.9.8 development pre-release and a live git ebuild (bug #444814, thanks to Pavel Šimerda and Sobhan Mohammadpour). Lots of improvements and bugfixes. Wimax support has been disabled until we have a libnl:3 compatible version in portage.

(Portage version: 2.2.0_alpha161/cvs/Linux x86_64, signed Manifest commit with key CF0ADD61)

1 tetromino 1.1 #!/sbin/runscript
2     # Copyright (c) 2008 Saleem Abdulrasool <compnerd@compnerd.org>
3     # Distributed under the terms of the GNU General Purpose License v2
4     # $Header: $
5    
6     description="NetworkManager daemon. The service is marked as started only \
7     when a network connection is established."
8    
9     depend() {
10     need dbus
11     provide net
12     }
13    
14     start() {
15     # If we are re-called by a dispatcher event, we want to mark the service
16     # as started without starting the daemon again
17     yesno "${IN_BACKGROUND}" && return 0
18    
19     [ -z "${INACTIVE_TIMEOUT}" ] && INACTIVE_TIMEOUT="1"
20    
21     ebegin "Starting NetworkManager"
22     start-stop-daemon --start --quiet --pidfile /run/NetworkManager/NetworkManager.pid \
23     --exec /usr/sbin/NetworkManager -- --pid-file /run/NetworkManager/NetworkManager.pid
24     local _retval=$?
25     eend "${_retval}"
26     if [ "x${_retval}" = 'x0' ] && ! nm-online -t "${INACTIVE_TIMEOUT}"; then
27     einfo "Marking NetworkManager as inactive. It will automatically be marked"
28     einfo "as started after a network connection has been established."
29     mark_service_inactive
30     fi
31     return "${_retval}"
32     }
33    
34     stop() {
35     # If we are re-called by a dispatcher event, we want to mark the service
36     # as inactive without stopping the daemon
37     if yesno "${IN_BACKGROUND}"; then
38     mark_service_inactive "${SVCNAME}"
39     return 0
40     fi
41    
42     ebegin "Stopping NetworkManager"
43     local pidfile=/run/NetworkManager/NetworkManager.pid
44     if [ ! -e "${pidfile}" ] && [ -e /var/run/NetworkManager.pid ]; then
45     # Try stopping the pid file used by <0.9.7
46     pidfile=/var/run/NetworkManager.pid
47     start-stop-daemon --stop --quiet --pidfile "${pidfile}"
48     ret=$?
49     [ ${ret} = 0 ] && [ -e "${pidfile}" ] && rm "${pidfile}"
50     eend ${ret}
51     else
52     start-stop-daemon --stop --quiet --pidfile "${pidfile}"
53     eend $?
54     fi
55     }
56    
57     # vim: set ft=gentoo-init-d ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20