[系统教程] 叒一个!一键全自动 DD 安装 Windows系统
作者:CC下载站 日期:2019-10-29 15:23:45 浏览:1776 分类:玩电脑
本文转载整理自:https://moeclub.org/2017/11/19/483/
环境需求
Debian/Ubuntu/CentOS 系统(由 GRUB引导);wget 用来下载文件,获取公网IP;ip 获取网关,掩码等;sed awk grep 处理文本流;VNC 安装系统(此项为可选)。 无DHCP时额外需求: iconv
#Debian/Ubuntu## 一般自带#RedHat/CentOSyum install glibc-common |
使用限制
需要定制dd包.默认Administrator账户登录.默认开启远程桌面(默认3389端口). 适当的调整防火墙.(可选)需要相关的虚拟化驱动.VirtIO驱动(备份下载) XEN驱动(备份下载) dd包解压后的体积不能超过机器第一块硬盘的最大容积.
安装脚本
wget --no-check-certificate -qO DebianNET.sh 'https://moeclub.org/attachment/LinuxShell/DebianNET.sh' && bash DebianNET.sh -dd '[Windows dd包直连地址]' |
萌咖提供的dd包:
#在你的机器上全新安装,如果你有VNC,可以看到全部过程. https://moeclub.org/get-win7embx86-auto# 该包只添加了VirtIO驱动,理论上仅能在KVM,Hyper-V构架下正常运行.# 如需在其他虚拟化构架下运行,请自行添加相关虚拟化驱动. |
使用的是Windows Embedded Standard 7(Thin PC)作为底包,官方精简.
如需其他组件,例如:完整的桌面特征,Windows照片查看器等.
使用示例
wget --no-check-certificate -qO DebianNET.sh 'https://moeclub.org/attachment/LinuxShell/DebianNET.sh' && bash DebianNET.sh -dd 'https://moeclub.org/get-win7embx86-auto' |
注意事项:
远程登陆账号为: Administrator远程登陆密码为: Vicer仅修改了主机名,可放心使用.(建议自己制作.)如果因此违反了TOS,萌咖不负任何责任.
代码备份
#!/bin/bashwhile [[ $# -ge 1 ]]; docase $1 in-v|--ver)shiftVERtmp="$1"shift;;-d|--debian|--ubuntu)shiftvDEBtmp="$1"shift;;-dd|--ddwin)shiftddMode='1'URLtmp="$1"shift;;-p|--password)shiftWDtmp="$1"shift;;-a|--auto)shiftINStmp='auto';;-m|--manual)shiftINStmp='manual';;-apt|--mirror)shiftisMirror='1'tmpMirror="$1"shift;;-ssl)shifttmpSSL="$1"shift;;*)echo -ne " Usage:\n\tbash $0\t-d/--debian [7/3[33m3[04mwheezy3[0m|8/jessie|9/stretch]\n\t\t\t\t-v/--ver [32/3[33m3[04mi3863[0m|64/amd64]\n\t\t\t\t-apt/--mirror\n\t\t\t\t-dd/--ddwin\n\t\t\t\t-a/--auto\n\t\t\t\t-m/--manual\n"exit 1;;;esacdone[[ $EUID -ne 0 ]] && echo "Error:This script must be run as root!" && exit 1[[ -f /boot/grub/grub.cfg ]] && GRUBOLD='0' && GRUBDIR='/boot/grub' && GRUBFILE='grub.cfg'[[ -z $GRUBDIR ]] && [[ -f /boot/grub2/grub.cfg ]] && GRUBOLD='0' && GRUBDIR='/boot/grub2' && GRUBFILE='grub.cfg'[[ -z $GRUBDIR ]] && [[ -f /boot/grub/grub.conf ]] && GRUBOLD='1' && GRUBDIR='/boot/grub' && GRUBFILE='grub.conf'[ -z $GRUBDIR -o -z $GRUBFILE ] && echo "Error! Not Found grub path." && exit 1[[ -n $vDEBtmp ]] && {[ "$vDEBtmp" == '7' -o "$vDEBtmp" == 'wheezy' ] && linuxdists='debian' && vDEB='wheezy';[ "$vDEBtmp" == '8' -o "$vDEBtmp" == 'jessie' ] && linuxdists='debian' && vDEB='jessie';[ "$vDEBtmp" == '9' -o "$vDEBtmp" == 'stretch' ] && linuxdists='debian' && vDEB='stretch';[[ "$vDEBtmp" == 'precise' ]] && linuxdists='ubuntu' && vDEB='precise';[[ "$vDEBtmp" == 'trusty' ]] && linuxdists='ubuntu' && vDEB='trusty';[[ "$vDEBtmp" == 'wily' ]] && linuxdists='ubuntu' && vDEB='wily';[[ "$vDEBtmp" == 'xenial' ]] && linuxdists='ubuntu' && vDEB='xenial';[[ "$vDEBtmp" == 'yakkety' ]] && linuxdists='ubuntu' && vDEB='yakkety';[[ "$vDEBtmp" == 'zesty' ]] && linuxdists='ubuntu' && vDEB='zesty';}[[ -n $vDEBtmp ]] && {[ "$VERtmp" == '32' -o "$VERtmp" == 'i386' ] && VER='i386';[ "$VERtmp" == '64' -o "$VERtmp" == 'amd64' ] && VER='amd64';}[[ -n $ddMode ]] && [[ "$ddMode" == '1' ]] && {[[ -n $URLtmp ]] && {linuxdists='debian';vDEB='jessie';VER='amd64';INStmp='auto'DDURL="$URLtmp"[[ -n $tmpSSL ]] && CURL_SUPPORT="$tmpSSL"[[ -z $CURL_SUPPORT ]] && CURL_SUPPORT='https://moeclub.org/get-curl_udeb_amd64'} || {echo 'Please input vaild URL! 'exit 1}} || {ddMode='0';}[[ -z $linuxdists ]] && linuxdists='debian'[[ -n $isMirror ]] && [[ "$isMirror" == '1' ]] && [[ -n $tmpMirror ]] && {tmpDebianMirror="$(echo -n "$tmpMirror" |grep -Eo '.*\.(\w+)')"echo -n "$tmpDebianMirror" |grep -q '://'[[ $? -eq '0' ]] && {DebianMirror="$(echo -n "$tmpDebianMirror" |awk -F'://' '{print $2}')"} || {DebianMirror="$(echo -n "$tmpDebianMirror")"}} || {[[ $linuxdists == 'debian' ]] && DebianMirror='httpredir.debian.org'[[ $linuxdists == 'ubuntu' ]] && DebianMirror='archive.ubuntu.com'}[[ -z $DebianMirrorDirectory ]] && [[ -n $DebianMirror ]] && [[ -n $tmpMirror ]] && {DebianMirrorDirectory="$(echo -n "$tmpMirror" |awk -F''${DebianMirror}'' '{print $2}' |sed 's/\/$//g')"}[[ "$DebianMirrorDirectory" == '/' ]] && [[ -n $DebianMirror ]] && {[[ $linuxdists == 'debian' ]] && DebianMirrorDirectory='/debian'[[ $linuxdists == 'ubuntu' ]] && DebianMirrorDirectory='/ubuntu'}[[ -z $DebianMirrorDirectory ]] && [[ -n $DebianMirror ]] && {[[ $linuxdists == 'debian' ]] && DebianMirrorDirectory='/debian'[[ $linuxdists == 'ubuntu' ]] && DebianMirrorDirectory='/ubuntu'}[[ -n $INStmp ]] && {[[ "$INStmp" == 'auto' ]] && inVNC='n'[[ "$INStmp" == 'manual' ]] && inVNC='y'}[[ -n $WDtmp ]] && myPASSWORD="$WDtmp"[[ -z $vDEB ]] && vDEB='wheezy';[[ -z $VER ]] && VER='i386';[[ -z $myPASSWORD ]] && myPASSWORD='Vicer'clear && echo -e "\n3[36m# Install3[0m\n"[[ -z $inVNC ]] && ASKVNC(){inVNC='y';[[ "$ddMode" == '0' ]] && {echo -ne "3[34mCan you login VNC?3[0m\e[33m[\e[32my\e[33m/n]\e[0m "read inVNCtmp[[ -n "$inVNCtmp" ]] && inVNC=$inVNCtmp}[ "$inVNC" == 'y' -o "$inVNC" == 'Y' ] && inVNC='y'[ "$inVNC" == 'n' -o "$inVNC" == 'N' ] && inVNC='n'}[ "$inVNC" == 'y' -o "$inVNC" == 'n' ] || ASKVNC;[[ $linuxdists == 'debian' ]] && LinuxName='Debian'[[ $linuxdists == 'ubuntu' ]] && LinuxName='Ubuntu'[[ "$ddMode" == '0' ]] && { [[ "$inVNC" == 'y' ]] && echo -e "3[34mManual Mode3[0m insatll 3[33m$LinuxName3[0m [3[33m$vDEB3[0m] [3[33m$VER3[0m] in VNC. "[[ "$inVNC" == 'n' ]] && echo -e "3[34mAuto Mode3[0m insatll 3[33m$LinuxName3[0m [3[33m$vDEB3[0m] [3[33m$VER3[0m]. "}[[ "$ddMode" == '1' ]] && {echo -ne "3[34mAuto Mode3[0m insatll 3[33mWindows3[0m\n[3[33m$DDURL3[0m]\n"}echo -e "\n[3[33m$vDEB3[0m] [3[33m$VER3[0m] Downloading..."[[ -z $DebianMirror ]] && echo -ne "3[31mError! 3[0mGet debian mirror fail! \n" && exit 1[[ -z $DebianMirrorDirectory ]] && echo -ne "3[31mError! 3[0mGet debian mirror directory fail! \n" && exit 1wget --no-check-certificate -qO '/boot/initrd.gz' "http://$DebianMirror$DebianMirrorDirectory/dists/$vDEB/main/installer-$VER/current/images/netboot/$linuxdists-installer/$VER/initrd.gz"[[ $? -ne '0' ]] && echo -ne "3[31mError! 3[0mDownload 'initrd.gz' failed! \n" && exit 1wget --no-check-certificate -qO '/boot/linux' "http://$DebianMirror$DebianMirrorDirectory/dists/$vDEB/main/installer-$VER/current/images/netboot/$linuxdists-installer/$VER/linux"[[ $? -ne '0' ]] && echo -ne "3[31mError! 3[0mDownload 'linux' failed! \n" && exit 1DEFAULTNET="$(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 |sed 's/proto.*\|onlink.*//g' |awk '{print $NF}')"[[ -n "$DEFAULTNET" ]] && IPSUB="$(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\}')"IPv4="$(echo -n "$IPSUB" |cut -d'/' -f1)"NETSUB="$(echo -n "$IPSUB" |grep -o '/[0-9]\{1,2\}')"GATE="$(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\}')"[[ -n "$NETSUB" ]] && MASK="$(echo -n '128.0.0.0/1,192.0.0.0/2,224.0.0.0/3,240.0.0.0/4,248.0.0.0/5,252.0.0.0/6,254.0.0.0/7,255.0.0.0/8,255.128.0.0/9,255.192.0.0/10,255.224.0.0/11,255.240.0.0/12,255.248.0.0/13,255.252.0.0/14,255.254.0.0/15,255.255.0.0/16,255.255.128.0/17,255.255.192.0/18,255.255.224.0/19,255.255.240.0/20,255.255.248.0/21,255.255.252.0/22,255.255.254.0/23,255.255.255.0/24,255.255.255.128/25,255.255.255.192/26,255.255.255.224/27,255.255.255.240/28,255.255.255.248/29,255.255.255.252/30,255.255.255.254/31,255.255.255.255/32' |grep -o '[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}'${NETSUB}'' |cut -d'/' -f1)"[[ -n "$GATE" ]] && [[ -n "$MASK" ]] && [[ -n "$IPv4" ]] || {echo "Not found `ip command`, It will use `route command`."ipNum() {local IFS='.'read ip1 ip2 ip3 ip4 <<<"$1"echo $((ip1*(1<<24)+ip2*(1<<16)+ip3*(1<<8)+ip4))}SelectMax(){ii=0for IPITEM in `route -n |awk -v OUT=$1 '{print $OUT}' |grep '[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}'`doNumTMP="$(ipNum $IPITEM)"eval "arrayNum[$ii]='$NumTMP,$IPITEM'"ii=$[$ii+1]doneecho ${arrayNum[@]} |sed 's/\s/\n/g' |sort -n -k 1 -t ',' |tail -n1 |cut -d',' -f2}[[ -z $IPv4 ]] && IPv4="$(ifconfig |grep 'Bcast' |head -n1 |grep -o '[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}' |head -n1)"[[ -z $GATE ]] && GATE="$(SelectMax 2)"[[ -z $MASK ]] && MASK="$(SelectMax 3)"[[ -n "$GATE" ]] && [[ -n "$MASK" ]] && [[ -n "$IPv4" ]] || {echo "Error! Not configure network. "exit 1}}[[ -f /etc/network/interfaces ]] && {[[ -z "$(sed -n '/iface.*inet static/p' /etc/network/interfaces)" ]] && AutoNet='1' || AutoNet='0'[[ -d /etc/network/interfaces.d ]] && {ICFGN="$(find /etc/network/interfaces.d -name '*.cfg' |wc -l)" || ICFGN='0'[[ "$ICFGN" -ne '0' ]] && {for NetCFG in `ls -1 /etc/network/interfaces.d/*.cfg` do [[ -z "$(cat $NetCFG | sed -n '/iface.*inet static/p')" ]] && AutoNet='1' || AutoNet='0'[[ "$AutoNet" -eq '0' ]] && breakdone}}}[[ -d /etc/sysconfig/network-scripts ]] && {ICFGN="$(find /etc/sysconfig/network-scripts -name 'ifcfg-*' |grep -v 'lo'|wc -l)" || ICFGN='0'[[ "$ICFGN" -ne '0' ]] && {for NetCFG in `ls -1 /etc/sysconfig/network-scripts/ifcfg-* |grep -v 'lo$' |grep -v ':[0-9]\{1,\}'` do [[ -n "$(cat $NetCFG | sed -n '/BOOTPROTO.*[dD][hH][cC][pP]/p')" ]] && AutoNet='1' || {AutoNet='0' && . $NetCFG[[ -n $NETMASK ]] && MASK="$NETMASK"[[ -n $GATEWAY ]] && GATE="$GATEWAY"}[[ "$AutoNet" -eq '0' ]] && breakdone}}[[ ! -f $GRUBDIR/$GRUBFILE ]] && echo "Error! Not Found $GRUBFILE. " && exit 1[[ ! -f $GRUBDIR/$GRUBFILE.old ]] && [[ -f $GRUBDIR/$GRUBFILE.bak ]] && mv -f $GRUBDIR/$GRUBFILE.bak $GRUBDIR/$GRUBFILE.oldmv -f $GRUBDIR/$GRUBFILE $GRUBDIR/$GRUBFILE.bak[[ -f $GRUBDIR/$GRUBFILE.old ]] && cat $GRUBDIR/$GRUBFILE.old >$GRUBDIR/$GRUBFILE || cat $GRUBDIR/$GRUBFILE.bak >$GRUBDIR/$GRUBFILE[[ "$GRUBOLD" == '0' ]] && {CFG0="$(awk '/menuentry /{print NR}' $GRUBDIR/$GRUBFILE|head -n 1)"CFG2="$(awk '/menuentry /{print NR}' $GRUBDIR/$GRUBFILE|head -n 2 |tail -n 1)"CFG1=""for CFGtmp in `awk '/}/{print NR}' $GRUBDIR/$GRUBFILE` do[ $CFGtmp -gt "$CFG0" -a $CFGtmp -lt "$CFG2" ] && CFG1="$CFGtmp"; done[[ -z "$CFG1" ]] && {echo "Error! read $GRUBFILE. "exit 1}sed -n "$CFG0,$CFG1"p $GRUBDIR/$GRUBFILE >/tmp/grub.new[[ -f /tmp/grub.new ]] && [[ "$(grep -c '{' /tmp/grub.new)" -eq "$(grep -c '}' /tmp/grub.new)" ]] || {echo -ne "3[31mError! 3[0mNot configure $GRUBFILE. \n"exit 1}sed -i "/menuentry.*/c\menuentry\ \'Install OS \[$vDEB\ $VER\]\'\ --class debian\ --class\ gnu-linux\ --class\ gnu\ --class\ os\ \{" /tmp/grub.new[[ "$(grep -c '{' /tmp/grub.new)" -eq "$(grep -c '}' /tmp/grub.new)" ]] || {echo "Error! configure append $GRUBFILE. "exit 1}sed -i "/echo.*Loading/d" /tmp/grub.new}[[ "$GRUBOLD" == '1' ]] && {CFG0="$(awk '/title /{print NR}' $GRUBDIR/$GRUBFILE|head -n 1)"CFG1="$(awk '/title /{print NR}' $GRUBDIR/$GRUBFILE|head -n 2 |tail -n 1)"[[ -n $CFG0 ]] && [ -z $CFG1 -o $CFG1 == $CFG0 ] && sed -n "$CFG0,$"p $GRUBDIR/$GRUBFILE >/tmp/grub.new[[ -n $CFG0 ]] && [ -z $CFG1 -o $CFG1 != $CFG0 ] && sed -n "$CFG0,$CFG1"p $GRUBDIR/$GRUBFILE >/tmp/grub.new[[ ! -f /tmp/grub.new ]] && echo "Error! configure append $GRUBFILE. " && exit 1sed -i "/title.*/c\title\ \'Install OS \[$vDEB\ $VER\]\'" /tmp/grub.newsed -i '/^#/d' /tmp/grub.new}[[ -n "$(grep 'initrd.*/' /tmp/grub.new |awk '{print $2}' |tail -n 1 |grep '^/boot/')" ]] && Type='InBoot' || Type='NoBoot'LinuxKernel="$(grep 'linux.*/' /tmp/grub.new |awk '{print $1}' |head -n 1)"[[ -z $LinuxKernel ]] && LinuxKernel="$(grep 'kernel.*/' /tmp/grub.new |awk '{print $1}' |head -n 1)"LinuxIMG="$(grep 'initrd.*/' /tmp/grub.new |awk '{print $1}' |tail -n 1)"[[ "$Type" == 'InBoot' ]] && {sed -i "/$LinuxKernel.*\//c\\t$LinuxKernel\t\/boot\/linux auto=true hostname=$linuxdists domain= -- quiet" /tmp/grub.newsed -i "/$LinuxIMG.*\//c\\t$LinuxIMG\t\/boot\/initrd.gz" /tmp/grub.new}[[ "$Type" == 'NoBoot' ]] && {sed -i "/$LinuxKernel.*\//c\\t$LinuxKernel\t\/linux auto=true hostname=$linuxdists domain= -- quiet" /tmp/grub.newsed -i "/$LinuxIMG.*\//c\\t$LinuxIMG\t\/initrd.gz" /tmp/grub.new}sed -i '$a\n' /tmp/grub.new[[ "$inVNC" == 'n' ]] && {GRUBPATCH='0'[ -f /etc/network/interfaces -o -d /etc/sysconfig/network-scripts ] && {sed -i ''${CFG0}'i\n' $GRUBDIR/$GRUBFILEsed -i ''${CFG0}'r /tmp/grub.new' $GRUBDIR/$GRUBFILE[[ -z $AutoNet ]] && echo "Error, Not found interfaces config." && exit 1[[ -f$GRUBDIR/grubenv ]] && sed -i 's/saved_entry/#saved_entry/g' $GRUBDIR/grubenv[[ -d /boot/tmp ]] && rm -rf /boot/tmpmkdir -p /boot/tmp/cd /boot/tmp/gzip -d < ../initrd.gz | cpio --extract --verbose --make-directories --no-absolute-filenames >>/dev/null 2>&1cat >/boot/tmp/preseed.cfg<<EOFd-i debian-installer/locale string en_USd-i console-setup/layoutcode string usd-i keyboard-configuration/xkb-keymap string usd-i netcfg/choose_interface select autod-i netcfg/disable_autoconfig boolean trued-i netcfg/dhcp_failed noted-i netcfg/dhcp_options select Configure network manuallyd-i netcfg/get_ipaddress string $IPv4d-i netcfg/get_netmask string $MASKd-i netcfg/get_gateway string $GATEd-i netcfg/get_nameservers string 8.8.8.8d-i netcfg/no_default_route boolean trued-i netcfg/confirm_static boolean trued-i hw-detect/load_firmware boolean falsed-i mirror/country string manuald-i mirror/http/hostname string $DebianMirrord-i mirror/http/directory string $DebianMirrorDirectoryd-i mirror/http/proxy stringd-i passwd/root-login boolean tured-i passwd/make-user boolean falsed-i passwd/root-password password $myPASSWORDd-i passwd/root-password-again password $myPASSWORDd-i user-setup/allow-password-weak boolean trued-i user-setup/encrypt-home boolean falsed-i clock-setup/utc boolean trued-i time/zone string US/Easternd-i clock-setup/ntp boolean trued-i preseed/early_command string anna-install libfuse2-udeb fuse-udeb ntfs-3g-udeb fuse-modules-3.16.0-4-amd64-did-i partman/early_command string \debconf-set partman-auto/disk "$(list-devices disk |head -n1)"; \wget -qO- '$DDURL' |gunzip -dc |/bin/dd of=$(list-devices disk |head -n1); \mount.ntfs-3g $(list-devices partition |head -n1) /mnt; \cp -f '/net.bat' '/mnt/ProgramData/Microsoft/Windows/Start Menu/Programs/Startup/net.bat'; \/sbin/reboot; \debconf-set grub-installer/bootdev string "$(list-devices disk |head -n1)"; \umount /media || true; \d-i partman/mount_style select uuidd-i partman-auto/init_automatically_partition select Guided - use entire diskd-i partman-auto/method string regulard-i partman-lvm/device_remove_lvm boolean trued-i partman-md/device_remove_md boolean trued-i partman-auto/choose_recipe select atomicd-i partman-partitioning/confirm_write_new_label boolean trued-i partman/choose_partition select finishd-i partman-lvm/confirm boolean trued-i partman-lvm/confirm_nooverwrite boolean trued-i partman/confirm boolean trued-i partman/confirm_nooverwrite boolean trued-i debian-installer/allow_unauthenticated boolean truetasksel tasksel/first multiselect minimald-i pkgsel/update-policy select noned-i pkgsel/include string openssh-serverd-i pkgsel/upgrade select nonepopularity-contest popularity-contest/participate boolean falsed-i grub-installer/only_debian boolean trued-i grub-installer/bootdev string defaultd-i finish-install/reboot_in_progress noted-i debian-installer/exit/reboot boolean trued-i preseed/late_command string\sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /target/etc/ssh/sshd_config; \sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /target/etc/ssh/sshd_config;EOF[[ "$AutoNet" -eq '1' ]] && {sed -i '/netcfg\/disable_autoconfig/d' /boot/tmp/preseed.cfgsed -i '/netcfg\/dhcp_options/d' /boot/tmp/preseed.cfgsed -i '/netcfg\/get_.*/d' /boot/tmp/preseed.cfgsed -i '/netcfg\/confirm_static/d' /boot/tmp/preseed.cfg}[[ "$vDEB" == 'trusty' ]] && GRUBPATCH='1'[[ "$vDEB" == 'wily' ]] && GRUBPATCH='1'[[ "$GRUBPATCH" == '1' ]] && {sed -i 's/^d-i\ grub-installer\/bootdev\ string\ default//g' /boot/tmp/preseed.cfg}[[ "$GRUBPATCH" == '0' ]] && {sed -i 's/debconf-set\ grub-installer\/bootdev.*\"\;//g' /boot/tmp/preseed.cfg}[[ "$vDEB" == 'xenial' ]] && {sed -i 's/^d-i\ clock-setup\/ntp\ boolean\ true/d-i\ clock-setup\/ntp\ boolean\ false/g' /boot/tmp/preseed.cfg}[[ "$linuxdists" == 'debian' ]] && {sed -i '/user-setup\/allow-password-weak/d' /boot/tmp/preseed.cfgsed -i '/user-setup\/encrypt-home/d' /boot/tmp/preseed.cfgsed -i '/pkgsel\/update-policy/d' /boot/tmp/preseed.cfgsed -i 's/umount\ \/media.*true\;\ //g' /boot/tmp/preseed.cfg}[[ "$ddMode" == '1' ]] && {[[ "$AutoNet" -eq '1' ]] && echo -ne "@ECHO OFF\r\ncd07d025ProgramData57Microsoft7Windows7Start0Menu7Programs7Startup2\r\ndel07f07q0net6bat\r\n\r\n" >'/boot/tmp/net.tmp';[[ "$AutoNet" -eq '0' ]] && echo -ne "@ECHO OFF\r\ncd665windir5\GetAdmin\r\nif0exist05windir5\GetAdmin00del07f07q025windir5\GetAdmin210else00\r\necho0CreateObject^02Shell6Application2^16ShellExecute025~s024025224022402runas2401066025temp5\Admin6vbs2\r\n25temp5\Admin6vbs2\r\ndel07f07q025temp5\Admin6vbs2\r\nexit07b021\r\nfor07f02tokens=322055i0in007netsh0interface0show0interface0^|more0+30^|findstr07R02本地620以太620Local620Ethernet2710do00set0EthName=55j1\r\nnetsh0-c0interface0ip0set0address0name=25EthName520source=static0address=$IPv40mask=$MASK0gateway=$GATE\r\nnetsh0-c0interface0ip0add0dnsservers0name=25EthName52 address=06060600index=10validate=no\r\nnetsh0-c0interface0ip0add0dnsservers0name=25EthName520address=06064640index=20validate=no\r\ncd07d025ProgramData57Microsoft7Windows7Start0Menu7Programs7Startup2\r\ndel07f07q0net6bat\r\n\r\n" >'/boot/tmp/net.tmp';iconv -f 'UTF-8' -t 'GBK' '/boot/tmp/net.tmp' -o '/boot/tmp/net.bat'rm -rf '/boot/tmp/net.tmp'echo "$DDURL" |grep -q '^https://'[[ $? -eq '0' ]] && {echo -ne '\nAdd curl support...\n'[[ -n $CURL_SUPPORT ]] && {wget --no-check-certificate -qO- "$CURL_SUPPORT" |tar -x[[ ! -f/boot/tmp/usr/bin/curl ]] && echo 'Error! CURL_SUPPORT.' && exit 1;sed -i 's/wget\ -qO-/\/usr\/bin\/curl -ksSL/g' /boot/tmp/preseed.cfg[[ $? -eq '0' ]] && echo 'Success! \n\n'} || {echo -ne 'Not curl support package! \n\n'exit 1}}}[[ "$ddMode" == '0' ]] && {sed -i '/anna-install/d' /boot/tmp/preseed.cfgsed -i 's/wget.*\/sbin\/reboot\;\ //g' /boot/tmp/preseed.cfg}rm -rf ../initrd.gzfind . | cpio -H newc --create --verbose | gzip -9 > ../initrd.gzrm -rf /boot/tmp}}[[ "$inVNC" == 'y' ]] && {sed -i '$i\n' $GRUBDIR/$GRUBFILEsed -i '$r /tmp/grub.new' $GRUBDIR/$GRUBFILEecho -e "\n3[33m3[04mIt will reboot! \nPlease look at VNC! \nSelect3[0m3[32m Install OS [$vDEB $VER] 3[33m3[4mto install system.3[04m\n\n3[31m3[04mThere is some information for you.\nDO NOT CLOSE THE WINDOW! 3[0m\n"echo -e "3[35mIPv4\t\tNETMASK\t\tGATEWAY3[0m"echo -e "3[36m3[04m$IPv43[0m\t3[36m3[04m$MASK3[0m\t3[36m3[04m$GATE3[0m\n\n"read -n 1 -p "Press Enter to reboot..." INPif [[ "$INP" != '' ]] ; thenecho -ne '\b \n'echo "";fi}chown root:root $GRUBDIR/$GRUBFILEchmod 444 $GRUBDIR/$GRUBFILEsleep 3 && reboot >/dev/null 2>&1 |
猜你还喜欢
- 03-22 [系统教程]笔记本怎么用触摸板实现滑动操作
- 03-22 [系统教程]玩游戏fps低怎么办
- 03-22 [系统教程]电脑卡慢的原因是及解决方法
- 03-22 [系统教程]UEFI+GPT装系统和传统的MBR方式有什么不同
- 03-22 [系统教程]电脑开机异常进不了系统
- 03-22 [系统教程]Windows无法更新计算机的启动配置 无法安装怎么办
- 03-22 [系统教程]安装系统提示无法创建新的分区
- 03-22 [系统教程]GPT一键安装win7失败怎么办
- 03-22 [系统教程]无线鼠标不动怎么办
- 10-22 [系统教程] CentOS6.5详细系统安装教程(图文教程)
- 10-29 [系统教程] #小米开放云#免费云服务器安装Windows系统
- 10-29 [系统教程] Windows激活之路:Win10 获取数字许可证批处理版(萌咖定制)
取消回复欢迎 你 发表评论:
- 精品推荐!
-
- 最新文章
- 热门文章
- 热评文章
[动画] 迪士尼系列动画139部 国英双语音轨 【蓝光珍藏版440GB】
[电影] 莫妮卡贝鲁奇为艺术献身电影大合集 1080P超清 双语字幕
[电影] DC电影宇宙系列合集18部 4K 高码率 内嵌中英字幕 273G
[音乐] 【坤曲/4坤时】鸡你太美全网最全,385首小黑子战歌,黄昏见证虔诚的信徒,巅峰诞生虚伪的拥护!
[音乐] 用餐背景音乐大合集 [MP3/flac]
[书籍] 彭子益医书合集 [PDF/DOC]
[电影] 《环太平洋两部合集》 4K REMUX原盘 [杜比视界] 国英双语音轨 [内封特效字幕] [133.8G]
[电影] 异人之下 The Traveller 2024✨【影版】【4K正式版/HQ超高码/DDP5.1】✚【1080高码】无水印/无压缩
[动漫] 头文字D 动漫 (1998) S01-S06季 1080P 国粤日音轨 续作 剧场版 电影
[小说] 知轩藏书全站7667册txt小说合集精心校对版
[书籍] 彭子益医书合集 [PDF/DOC]
[游戏] 《黑神话悟空》免安装学习版【全dlc整合完整版】+Steam游戏解锁+游戏修改工具!
[动画] 《名侦探柯南》名侦探柯南百万美元的五菱星 [TC] [MP4]
[电视剧集] [BT下载][黑暗城市- 清扫魔 Dark City: The Cleaner 第一季][全06集][英语无字][MKV][720P/1080P][WEB-RAW]
[涨点姿势] 男性性技宝典:14招实战驭女术——爱抚、按摩、催情、姿势、高潮全攻略
[动画] 2002《火影忍者》720集全【4K典藏版】+11部剧场版+OVA+漫画 内嵌简日字幕
[剧集] 《斯巴达克斯》1-4季合集 无删减版 1080P 内嵌简英特效字幕
[CG剧情] 《黑神话:悟空》158分钟CG完整剧情合集 4K120帧最高画质
[短剧] 被下架·禁播的羞羞短剧·午夜短剧合集
[游戏] 黑神话悟空离线完整版+修改器
[影视] 美国内战 4K蓝光原盘下载+高清MKV版/内战/帝国浩劫:美国内战(台)/美帝崩裂(港) 2024 Civil War 63.86G
[影视] 一命 3D 蓝光高清MKV版/切腹 / 切腹:武士之死 / Hara-Kiri: Death of a Samurai / Ichimei 2011 一命 13.6G
[影视] 爱情我你他 蓝光原盘下载+高清MKV版/你、我、他她他 2005 Me and You and Everyone We Know 23.2G
[影视] 穿越美国 蓝光原盘下载+高清MKV版/窈窕老爸 / 寻找他妈…的故事 2005 Transamerica 20.8G
[电影] 《黄飞鸿》全系列合集
[Android] 开罗游戏 ▎像素风格的模拟经营的游戏厂商安卓游戏大合集
[游戏合集] 要战便战 v0.9.107 免安装绿色中文版
[书籍] 彭子益医书合集 [PDF/DOC]
[资源] 精整2023年知识星球付费文合集136篇【PDF格式】
[系统]【黑果小兵】macOS Big Sur 11.0.1 20B50 正式版 with Clover 5126 黑苹果系统镜像下载
- 最新评论
-
有靳东!嘻嘻奥古斯都.凯撒 评论于:10-28 流星花园是F4处女作也是4人集体搭配的唯一一部!奥古斯都.凯撒 评论于:10-28 找了好久的资源,终于在这里找到了。感谢本站的资源和分享。谢谢AAAAA 评论于:10-26 找了好久的资源,终于在这里找到了。感谢本站的资源和分享。谢谢password63 评论于:10-26 找了好久的资源,终于在这里找齐了!!!!blog001 评论于:10-21 找了好久的资源,终于在这里找齐了!!!!blog001 评论于:10-21 找了好久的资源,终于在这里找到了。感谢本站的资源和分享。谢谢WillKwok 评论于:10-09 感谢分享1234123 评论于:10-07 太好了终于找到了谢谢Tom 评论于:10-07 谢谢分享loonghd 评论于:09-30
- 热门tag