跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

udhcpc.sh

68 行 · 1.5 KB历史下载
1#!/bin/sh
2# Busybox udhcpc dispatcher script. Copyright (C) 2009 by Axel Beckert.
3#
4# Based on the busybox example scripts and the old udhcp source
5# package default.* scripts.
6
7RESOLV_CONF="/etc/resolv.conf"
8
9case $1 in
10 bound|renew)
11 [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
12 [ -n "$subnet" ] && NETMASK="netmask $subnet"
13 [ -n "$mtu" ] && MTU="mtu $mtu"
14
15 ifconfig $interface $ip $BROADCAST $NETMASK $MTU
16
17 if [ -n "$router" ]; then
18 echo "$0: Resetting default routes"
19 while route del default gw 0.0.0.0 dev $interface; do :; done
20
21 metric=0
22 for i in $router; do
23 if [ "$subnet" = "255.255.255.255" ]; then
24 ip route add default via $i dev $interface metric $metric onlink
25 else
26 ip route add default via $i dev $interface metric $metric
27 fi
28 metric=$(($metric + 1))
29 done
30 fi
31
32 # Update resolver configuration file
33 R=""
34 [ -n "$domain" ] && R="domain $domain
35"
36 for i in $dns; do
37 echo "$0: Adding DNS $i"
38 R="${R}nameserver $i
39"
40 done
41
42 if [ -x resolvconf ]; then
43 echo -n "$R" | resolvconf -a "${interface}.udhcpc"
44 else
45 echo -n "$R" > "$RESOLV_CONF"
46 fi
47 ;;
48
49 deconfig)
50 if [ -x resolvconf ]; then
51 resolvconf -d "${interface}.udhcpc"
52 fi
53 ifconfig $interface 0.0.0.0
54 ;;
55
56 leasefail)
57 echo "$0: Lease failed: $message"
58 ;;
59
60 nak)
61 echo "$0: Received a NAK: $message"
62 ;;
63
64 *)
65 echo "$0: Unknown udhcpc command: $1";
66 exit 1;
67 ;;
68esac