Skip to content

Commit 3ce1229

Browse files
committed
更新 usb-netcard.sh 脚本,在处理网络接口时增强重启逻辑
1 parent 1c3ca97 commit 3ce1229

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/spk/syno-network/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SPK_NAME = syno-network
22
SPK_VERS = 1.0
3-
SPK_REV = 7
3+
SPK_REV = 8
44
SPK_ICON = src/$(SPK_NAME).png
55

66
DEPENDS =

src/spk/syno-network/src/udev/script/usb-netcard.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
# See /LICENSE for more information.
77
#
88

9+
# Logging
10+
_log() {
11+
echo "netcard: $*"
12+
/bin/logger -p "error" -t "netcard" "$@"
13+
}
14+
15+
_log "ACTION=${1}, NAME=${2}"
16+
917
ACTION=$([ "${1}" = "add" ] && echo "restart" || echo "stop")
1018
NAME=${2}
1119

@@ -86,6 +94,7 @@ eth*)
8694
MASTER=$(get_key_value "${IFCFGPRE}${ETHX}" "MASTER" 2>/dev/null)
8795
if [ -n "${MASTER}" ]; then
8896
[ "${ACTION}" = "restart" ] && {
97+
[ -z "${BRIDGE}" ] && /etc/rc.network "${ACTION}" "${ETHX}"
8998
set_kv "${IFCFGPRE}${ETHX}" "SLAVE" "no"
9099
/etc/rc.network "stop" "${ETHX}"
91100
set_kv "${IFCFGPRE}${ETHX}" "SLAVE" "yes"

0 commit comments

Comments
 (0)