#!/bin/bash # Network Interface Configuration System # Copyright (c) 1996-2009 Red Hat, Inc. all rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. . /etc/init.d/functions cd /etc/sysconfig/network-scripts . ./network-functions [ -f ../network ] && . ../network CONFIG=${1} source_config . /etc/sysconfig/network # Check to make sure the device is actually up check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a "$BOOTPROTO" != "bootp" ] && [ -n "$VLAN" -a "$VLAN" != "yes" ] && exit 0 if [ -n "${TEAM_MASTER}" ] && [ ! "${DEVICETYPE}" = "TeamPort" ] && [ -x ./ifdown-TeamPort ]; then ./ifdown-TeamPort ${CONFIG} $2 fi if [ "${SLAVE}" != "yes" -o -z "${MASTER}" ]; then if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then FOUNDMACADDR=$(get_hwaddr ${REALDEVICE}) if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then NEWCONFIG=$(get_config_by_hwaddr ${FOUNDMACADDR}) if [ -n "${NEWCONFIG}" ]; then eval $(LANG=C grep -F "DEVICE=" $NEWCONFIG) else net_log $"Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured address ${HWADDR}. Ignoring." exit 1 fi if [ -n "${NEWCONFIG}" -a "${NEWCONFIG##*/}" != "${CONFIG##*/}" -a "${DEVICE}" = "${REALDEVICE}" ]; then exec /sbin/ifdown ${NEWCONFIG} else net_log $"Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured address ${HWADDR}. Ignoring." exit 1 fi fi fi fi if is_bonding_device ${DEVICE} ; then for device in $(LANG=C grep -l "^[[:space:]]*MASTER=['\"]\?${DEVICE}['\"]\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*) ; do is_ignored_file "$device" && continue /sbin/ifdown ${device##*/} done for arg in $BONDING_OPTS ; do key=${arg%%=*}; [[ "${key}" != "arp_ip_target" ]] && continue value=${arg##*=}; if [ "${value:0:1}" != "" ]; then OLDIFS=$IFS; IFS=','; for arp_ip in $value; do if grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/arp_ip_target; then echo "-$arp_ip" > /sys/class/net/${DEVICE}/bonding/arp_ip_target fi done IFS=$OLDIFS; else value=${value#+}; if grep -q $value /sys/class/net/${DEVICE}/bonding/arp_ip_target; then echo "-$value" > /sys/class/net/${DEVICE}/bonding/arp_ip_target fi fi done fi /etc/sysconfig/network-scripts/ifdown-ipv6 ${CONFIG} retcode=0 [ -n "$(pidof -x dhclient)" ] && { for VER in "" 6 ; do if [ -f "/var/run/dhclient$VER-${DEVICE}.pid" ]; then dhcpid=$(cat /var/run/dhclient$VER-${DEVICE}.pid) generate_lease_file_name $VER if [[ "$DHCPRELEASE" = [yY1]* ]]; then /sbin/dhclient -r -lf ${LEASEFILE} -pf /var/run/dhclient$VER-${DEVICE}.pid ${DEVICE} >/dev/null 2>&1 retcode=$? else kill $dhcpid >/dev/null 2>&1 retcode=$? reason=STOP$VER interface=${DEVICE} /sbin/dhclient-script fi if [ -f "/var/run/dhclient$VER-${DEVICE}.pid" ]; then rm -f /var/run/dhclient$VER-${DEVICE}.pid kill $dhcpid >/dev/null 2>&1 fi fi done } # we can't just delete the configured address because that address # may have been changed in the config file since the device was # brought up. Flush all addresses associated with this # instance instead. if [ -d "/sys/class/net/${REALDEVICE}" ]; then LABEL= if [ "${REALDEVICE}" != "${DEVICE}" ]; then LABEL="label ${DEVICE}" fi if [ "${REALDEVICE}" = "lo" ]; then ip addr flush dev ${REALDEVICE} ${LABEL} scope host 2>/dev/null else ip addr flush dev ${REALDEVICE} ${LABEL} scope global 2>/dev/null ip -4 addr flush dev ${REALDEVICE} ${LABEL} scope host 2>/dev/null fi if [ "${SLAVE}" = "yes" -a -n "${MASTER}" ]; then echo "-${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null fi if [ "${REALDEVICE}" = "${DEVICE}" ]; then ip link set dev ${DEVICE} down 2>/dev/null fi fi [ "$retcode" = "0" ] && retcode=$? if [ -n "${BRIDGE}" ] && [ -x /usr/sbin/brctl ]; then /sbin/ip link set dev ${DEVICE} down /usr/sbin/brctl delif -- ${BRIDGE} ${DEVICE} # Upon removing a device from a bridge, # it's necessary to make radvd reload its config [ -r /var/run/radvd/radvd.pid ] && kill -HUP $(cat /var/run/radvd/radvd.pid) if [ -d /sys/class/net/${BRIDGE}/brif ] && [ $(ls -1 /sys/class/net/${BRIDGE}/brif | wc -l) -eq 0 ]; then /usr/sbin/brctl delbr -- ${BRIDGE} fi fi if [ "${TYPE}" = "Tap" ]; then TUNMODE="mode tap" [[ ${DEVICE} == tun* ]] && TUNMODE="mode tun" ip tuntap del ${TUNMODE} dev ${DEVICE} >/dev/null fi if [ -n "${TEAM_CONFIG}" ] && [ ! "${DEVICETYPE}" = "Team" ] && [ -x ./ifdown-Team ]; then ./ifdown-Team ${CONFIG} $2 fi # wait up to 5 seconds for device to actually come down... waited=0 while ! check_device_down ${DEVICE} && [ "$waited" -lt 50 ] ; do usleep 10000 waited=$(($waited+1)) done # don't leave an outdated key sitting around if [ -n "${WIRELESS_ENC_KEY}" ] && [ -x /sbin/iwconfig ]; then /sbin/iwconfig ${DEVICE} enc 0 >/dev/null 2>&1 fi if [ "$retcode" = 0 ] ; then /etc/sysconfig/network-scripts/ifdown-post $CONFIG # do NOT use $? because ifdown should return whether or not # the interface went down. fi if [ -n "$VLAN" ]; then # 802.1q VLAN if [ -f /proc/net/vlan/${DEVICE} ]; then ip link delete ${DEVICE} type vlan fi fi exit $retcode d='n84' href='#n84'>84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
<!-- INCLUDE mcp_header.html -->

<form method="post" id="mcp" action="{U_POST_ACTION}">

<h2>{L_TITLE}</h2>

<div class="panel">
	<div class="inner"><span class="corners-top"><span></span></span>

	<h3>{USERNAME_FULL}</h3>

	<div>
		<div class="column1">
			<!-- IF AVATAR_IMG --><div>{AVATAR_IMG}</div><!-- ENDIF -->
		</div>

		<div class="column2">
			<dl class="details">
				<!-- IF RANK_TITLE --><dt>{L_RANK}:</dt><dd>{RANK_TITLE}</dd><!-- ENDIF -->
				<!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt><dd>{RANK_IMG}</dd><!-- ENDIF -->
				<dt>{L_JOINED}:</dt><dd>{JOINED}</dd>
				<dt>{L_TOTAL_POSTS}:</dt><dd>{POSTS}</dd>
				<dt>{L_WARNINGS}: </dt><dd>{WARNINGS}</dd>
			</dl>
		</div>
	</div>

	<span class="corners-bottom"><span></span></span></div>
</div>

<div class="panel">
	<div class="inner"><span class="corners-top"><span></span></span>

	<h3>{L_ADD_FEEDBACK}</h3>
	<p>{L_ADD_FEEDBACK_EXPLAIN}</p>

	<fieldset>
		<textarea name="usernote" id="usernote" class="inputbox" cols="40" rows="3"></textarea>
	</fieldset>

	<span class="corners-bottom"><span></span></span></div>
</div>

<fieldset class="submit-buttons">
	{S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
	<input type="submit" name="action[add_feedback]" value="{L_SUBMIT}" class="button1" />
	{S_FORM_TOKEN}
</fieldset>

<div class="panel">
	<div class="inner"><span class="corners-top"><span></span></span>

	<ul class="linklist">
		<li class="leftside">
			{L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
		</li>
		<li class="rightside pagination">
			<!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} <!-- ENDIF -->
			<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
		</li>
	</ul>

	<table cellspacing="1" class="table1">
	<thead>
	<tr>
		<th>{L_REPORT_BY}</th>
		<th style="text-align: center">{L_IP}</th>
		<th style="text-align: center">{L_TIME}</th>
		<th>{L_ACTION_NOTE}</th>
		<!-- IF S_CLEAR_ALLOWED --><th>{L_MARK}</th><!-- ENDIF -->
	</tr>
	</thead>
	<tbody>
	<!-- BEGIN usernotes -->
	<!-- IF usernotes.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF -->
		<td>{usernotes.REPORT_BY}</td>
		<td style="text-align: center">{usernotes.IP}</td>
		<td style="text-align: center">{usernotes.REPORT_AT}</td>
		<td>{usernotes.ACTION}</td>

		<!-- IF S_CLEAR_ALLOWED --><td width="5%" align="center"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF -->
	</tr>
	<!-- BEGINELSE -->
	<tr>
		<td class="bg1" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->" align="center"><span class="gen">{L_NO_ENTRIES}</span></td>
	</tr>
	<!-- END usernames -->
	</tbody>
	</table>

	<hr />

	<fieldset class="display-options">
		<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
		<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
		<label>{L_DISPLAY_LOG}: {S_SELECT_SORT_DAYS}</label>
		<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
		<input type="submit" name="sort" value="{L_GO}" class="button2" />
	</fieldset>

	<hr />

	<ul class="linklist">
		<li class="rightside pagination">
			<!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS}<!-- ENDIF -->
			<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->