无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 4314|回复: 4
打印 上一主题 下一主题

[原创] RPBL Ryan P2P/BT Boot Linux (Debian Live Buster 10.x Server 服務端), 一鍵腳本

[复制链接]
跳转到指定楼层
1#
发表于 2020-6-15 14:01:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 hkkitlee 于 2020-6-15 14:14 编辑

伺服端一鍵更新Debian Live p2p/bt 啟動腳本
http://bbs.wuyou.net/forum.php?mod=viewthread&tid=415206
https://github.com/hkkitlee/P2P-Boot-Linux


#!/bin/bash


mkdir ~/siteiso ~/sitetorrent ~/sitetmp


rclone mount orgsiteiso:  ~/siteiso --daemon

rclone mount orgsitetorrent:  ~/sitetorrent --daemon


rm ~/sitetmp/initrd*

rm ~/sitetmp/vmlinuz*


rsync --info=progress2 ~/siteiso/*standard.iso ~/sitetmp/


mount ~/sitetmp/*standard.iso /mnt


cp /mnt/live/vmlinuz* ~/sitetmp/

cp /mnt/live/initrd* ~/sitetmp/


umount /mnt


rm ~/sitetmp/*standard.iso




cd ~/sitetmp/chroot/

zcat ~/sitetmp/initrd* | sudo cpio -i -H newc -d  #unpack from gz



cp aria2/aria2c ~/sitetmp/chroot/bin/

mkdir -p ~/sitetmp/chroot/etc/ssl/certs/

cp aria2/ca-certificates.crt ~/sitetmp/chroot/etc/ssl/certs/ca-certificates.crt


cp 9990-mount-http.sh ~/sitetmp/chroot/usr/lib/live/boot/




find | sudo cpio -o -H newc | gzip -2 > ../initrd.img  #pack to gz

rm ~/sitetmp/chroot/* -rf




###assign var and debug for script


vmlinuz=$(/bin/ls ~/sitetmp/ |/bin/grep vmlinuz)

initrd=$(/bin/ls ~/sitetmp/ |/bin/grep initrd.img)


cinnamont=$(/bin/ls ~/sitetorrent/ |/bin/grep cinnamon)

gnomet=$(/bin/ls ~/sitetorrent/ |/bin/grep gnome)

kdet=$(/bin/ls ~/sitetorrent/ |/bin/grep kde)

lxdet=$(/bin/ls ~/sitetorrent/ |/bin/grep lxde)

lxqtt=$(/bin/ls ~/sitetorrent/ |/bin/grep lxqt)

matet=$(/bin/ls ~/sitetorrent/ |/bin/grep mate)

standardt=$(/bin/ls ~/sitetorrent/ |/bin/grep standard)

xfcet=$(/bin/ls ~/sitetorrent/ |/bin/grep xfce)


echo 'Check for ${vmlinuz}='"${vmlinuz}"' ${initrd}='"${initrd}"

echo "${cinnamont}"

echo "${gnomet}"

echo "${kdet}"

echo "${lxdet}"

echo "${lxqtt}"

echo "${matet}"

echo "${standardt}"

echo "${xfcet}"





cat << EOF > /p2p.ipxe

#!ipxe


goto p2p


:p2p

menu                                    P2P Boot Official Debian Buster


item --gap  -- Local Info

item --gap  -- IP:              \${ip}

item --gap  -- Netmask:         \${netmask}

item --gap  -- Mac Address:     \${mac}

item --gap  -- DHCP:            \${dhcp-server}

item --gap  -- Gateway:         \${gateway}

item --gap  -- DNS:             \${dns}

item --gap  -- next-server(proxy):      \${next-server}, \${proxydhcp/next-server}

item --gap  -- Chip:                    \${chip}

item --gap  -- Platform:        \${platform}

item --gap  -- Build Arch:      \${buildarch}

item --gap  -- Version:         \${version}

item --gap  -- https://hkkitlee.ddns.net:9000/

item --gap


item --gap  -- kernel: ${vmlinuz}

item --key 0    lxqt                    (0) Lxqt

item --key 1    gnome                   (1) Gnome

item --key 2    kde                     (2) Kde

item --key 3    lxde                    (3) Lxde

item --key 4    mate                    (4) Mate

item --key 5    standard                (5) Standard

item --key 6    xfce                    (6) Xfce

item --key 7    cinnamon                (7) Cinnamon

item --key 0x12 start                   (Ctrl-R) Return to First Menu


item --gap Keyboard shortcut (1-7,Ctrl-R)


choose --default gnome --timeout 20000 target && goto \${target}


:RPBL

kernel ~/sitetmp/${vmlinuz} initrd=${initrd} boot=live vga=normal components splash dhcp hooks=filesystem fetch=\${image}

initrd ~/sitetmp/${initrd}

boot || goto failed



:gnome

cpair --foreground 0 --background 9 0

console

set image https://cdimage.debian.org/debia ... ve/amd64/bt-hybrid/${gnomet}

goto RPBL || goto failed



:cinnamon

cpair --foreground 0 --background 9 0

console

set image https://cdimage.debian.org/debia ... ve/amd64/bt-hybrid/${cinnamont}

goto RPBL || goto failed


:kde

cpair --foreground 0 --background 9 0

console

set image https://cdimage.debian.org/debia ... ve/amd64/bt-hybrid/${kdet}

goto RPBL || goto failed


:lxde

cpair --foreground 0 --background 9 0

console

set image https://cdimage.debian.org/debia ... ve/amd64/bt-hybrid/${lxdet}

goto RPBL || goto failed


:lxqt

cpair --foreground 0 --background 9 0

console

set image https://cdimage.debian.org/debia ... ve/amd64/bt-hybrid/${lxqtt}

goto RPBL || goto failed


:mate

cpair --foreground 0 --background 9 0

console

set image https://cdimage.debian.org/debia ... ve/amd64/bt-hybrid/${matet}

goto RPBL || goto failed


:standard

cpair --foreground 0 --background 9 0

console

set image https://cdimage.debian.org/debia ... ve/amd64/bt-hybrid/${standardt}

goto RPBL || goto failed


:xfce

cpair --foreground 0 --background 9 0

console

set image https://cdimage.debian.org/debia ... ve/amd64/bt-hybrid/${xfcet}

goto RPBL || goto failed



EOF



umount ~/sitetorrent

umount ~/siteiso




2#
发表于 2020-6-15 14:32:07 | 只看该作者
看不懂

点评

我也是。。  详情 回复 发表于 2020-6-15 18:43
回复

使用道具 举报

3#
发表于 2020-6-15 17:07:31 | 只看该作者
没看懂,
回复

使用道具 举报

4#
发表于 2020-6-15 18:43:37 | 只看该作者

我也是。。
回复

使用道具 举报

5#
发表于 2020-6-20 14:32:04 | 只看该作者
我还以为只有我一个人看不懂呀
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-4-24 07:34

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表