|
Lines 16-36
Link Here
|
| 16 |
[ -r /etc/sysconfig/network/config ] && . /etc/sysconfig/network/config |
16 |
[ -r /etc/sysconfig/network/config ] && . /etc/sysconfig/network/config |
| 17 |
[ -r /etc/sysconfig/network/scripts/functions ] && . /etc/sysconfig/network/scripts/functions |
17 |
[ -r /etc/sysconfig/network/scripts/functions ] && . /etc/sysconfig/network/scripts/functions |
| 18 |
|
18 |
|
| 19 |
command_exists dhcp_clients || exit $NA |
|
|
| 20 |
|
| 21 |
# NetworkManager is handled by 55NetworkManager, so skip this script if |
19 |
# NetworkManager is handled by 55NetworkManager, so skip this script if |
| 22 |
# nm is enabled in sysconfig ... |
20 |
# nm is enabled in sysconfig ... |
| 23 |
[ x"${NETWORKMANAGER}" -eq x"yes" ] && exit $NA |
21 |
[ x"${NETWORKMANAGER}" = x"yes" ] && exit $NA |
| 24 |
# ... or if is running |
22 |
# ... or if is running |
| 25 |
command_exists nm_running && nm_running && exit $NA |
23 |
command_exists nm_running && nm_running && exit $NA |
| 26 |
|
24 |
|
|
|
25 |
# check network/scripts/function provides dhcp_interfaces() |
| 26 |
# function returning a list of interfaces with running dhcp. |
| 27 |
command_exists dhcp_interfaces || exit $NA |
| 28 |
|
| 27 |
case "$1" in |
29 |
case "$1" in |
| 28 |
hibernate|suspend) |
30 |
hibernate|suspend) |
| 29 |
save_state "dhcp_clients" "`dhcp_clients`" |
31 |
savestate "dhcp_interfaces" "`dhcp_interfaces`" |
| 30 |
service network stop-all-dhcp-clients |
32 |
service network stop-all-dhcp-clients |
| 31 |
;; |
33 |
;; |
| 32 |
thaw|resume) |
34 |
thaw|resume) |
| 33 |
for interface in `restore_state "dhcp_clients"`; do |
35 |
for interface in `restorestate "dhcp_interfaces"`; do |
| 34 |
service network restart ${interface} |
36 |
service network restart ${interface} |
| 35 |
done |
37 |
done |
| 36 |
;; |
38 |
;; |