Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 636928 Details for
Bug 636080
Reset network setup reset after test if necessary
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
draft script for review
rhts-restore-network.sh (text/plain), 2.00 KB, created by
Qixiang Wan
on 2012-11-02 03:02:07 UTC
(
hide
)
Description:
draft script for review
Filename:
MIME Type:
Creator:
Qixiang Wan
Created:
2012-11-02 03:02:07 UTC
Size:
2.00 KB
patch
obsolete
>#!/bin/bash > ># Purpose: Restore the network with dhcp enabled for all interfaces ># in case network is broken (test by ping). ># Steps: ># 1. Try to ping the lab controller, nothing to be done if it works, ># otherwise go on for the next steps. ># 2. Enable dhcp in all /etc/sysconfig/network-scripts/ifcfg-* ># files (other than ifcfg-lo). ># 3. Check whether NetworkManager service is available, restart it ># if it's available, otherwise jump to step 6. ># 4. If the restart succeeds, try ping the lab controller again, ># 5. If the ping succeeds, jump to step 8. ># 6. Try to restart the network service, if it succeeds, try ping ># the lab controller again. ># 7. If the ping failed, bail out (we have nothing left to try) ># 8. Upload some logs. > >function ping-pong() { > ping -c 5 $LABCONTROLLER > /dev/null 2>&1 >} > >if ping-pong; then > exit 0 >else > NETWORK_IS_OK=0 > # Enable dhcp for all interfaces except 'lo' > for i in /etc/sysconfig/network-scripts/ifcfg-*; do > if [ _${i##*ifcfg-} != _'lo' ]; then > # If both BOOTPROTO=dhcp and static ip parameters > # are present, dhcp will take affect, so don't need > # to worry about static ip parameters. > sed -i -e '/^BOOTPROTO/d' -e '/^ONBOOT/d' $i > echo -e "BOOTPROTO=dhcp\nONBOOT=yes" >> $i > fi > done >fi > >if systemctl --version > /dev/null 2>&1; then > if systemctl list-units --type=service | grep -q NetworkManager.service;then > if systemctl restart NetworkManager.service > /dev/null 2>&1; then > ping-pong && NETWORK_IS_OK=1 > fi > elif systemctl restart network.service 2>&1; then > ping-pong && NETWORK_IS_OK=1 > fi >elif chkconfig --list | grep -q NetworkManager; then > if service NetworkManager restart > /dev/null 2>&1; then > ping-pong && NETWORK_IS_OK=1 > fi >elif service network restart > /dev/null 2>&1; then > ping-pong && NETWORK_IS_OK=1 >fi > >if [ $NETWORK_IS_OK -eq 1 ]; then > : #rhts_submit_log >else > exit 1 >fi
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 636080
: 636928