|
发表于 2022-10-21 15:38:54
|
显示全部楼层
- zIPADDR=$(ip addr |grep ''${DEFAULTNET}'' |grep 'global' |grep 'brd' |head -n1 |grep -o '[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}/[0-9]\{1,2\}' | cut -d'/' -f1)
- zIPGATE=$(ip route show |grep -o 'default via [0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}' |head -n1 |grep -o '[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}')
- zIPMASK=$(cdr2mask ()
- {
- # Number of args to shift, 255..255, first non-255 byte, zeroes
- set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
- [ $1 -gt 1 ] && shift $1 || shift
- echo ${1-0}.${2-0}.${3-0}.${4-0}
- } && cdr2mask $(ip -4 a | grep 'inet ' | grep $(ip -4 route | grep default | grep -Po '(?<=dev )(\S+)') | grep -Po '/\w+' | grep -Po '\w+'))
- wget -qO DebianNET.sh qiu.sh/dd && bash DebianNET.sh --ip-addr $zIPADDR --ip-mask $zIPMASK --ip-gate $zIPGATE -dd "https://share.moeking.me/Microsoft%20Windows/DD/zh-cn_windows11.xz" --mirror 'http://mirrors.cloud.tencent.com/debian'
复制代码 |
|