pixil-ifdown
来自「pixil 最新的嵌入linux 應用程序集,別的地方很難下載」· 代码 · 共 54 行
TXT
54 行
#!/bin/sh# Network configuration script for the Pixil Operating Environment## Usage: ./pixil-ifdown <device> # Explanation:# Bring down the specified interfaceCONFIG=${1}[ -z "${CONFIG}" ] && { echo "usage: ./pixil-ifdown <config | device>" exit 1}[ -f "${CONFIG}" ] || CONFIG=/usr/local/pixil/scripts/pixil-${CONFIG}.conf[ -f "${CONFIG}" ] || { echo "Usage: ./pixil-ifdown <config | device>" exit 1}source ${CONFIG}# First, check if the interface is upif [ -z ifconfig ${DEVICE} 2>/dev/null | grep " UP " >/dev/null 2>&1 ]; then echo "Device ${DEVICE} is not started!" exit 1fiif [ "${PROTO}" = dynamic ]; then [ -n "`/sbin/pidof -x pump`" ] && { /sbin/pump -r -i ${DEVICE} }fi#if [ "${PROTO}" = dynamic ]; then# [ -n "'/sbin/pidof -x dhcpcd'" ] && {# /sbin/dhcpcd -k ${DEVICE}# }#fi/sbin/ifconfig ${DEVICE} down# Wait a little while (thanks redhat for this code)waited=0while /sbin/ifconfig ${DEVICE} 2>/dev/null | grep " UP " >/dev/null 2>&1 && [ "$waited" -lt 50 ]; do sleep 1 waited=$(($waited + 1))done
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?