sh << 'EOF' #!/bin/sh # Alpine VNC Auto Install P="yiwan123" D="/dev/vda" R="http://mirrors.aliyun.com/alpine/v3.23" setup-interfaces -a -r sleep 2 cat>/tmp/a</mnt/etc/apk/repositories mount --bind /dev /mnt/dev mount --bind /proc /mnt/proc mount --bind /sys /mnt/sys chroot /mnt apk update chroot /mnt apk add util-linux grub grub-bios curl vim bash parted e2fsprogs umount /mnt/boot swapoff -a 2>/dev/null dd if=/dev/zero of=$D bs=1K seek=32 count=992 conv=notrunc dd if=/dev/zero of=$D bs=512 seek=1 count=33 conv=notrunc B=$(basename $D) S=$(cat /sys/block/$B/size) dd if=/dev/zero of=$D bs=512 seek=$((S-33)) count=33 conv=notrunc sync mount ${D}1 /mnt/boot chroot /mnt grub-install --recheck $D chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg chroot /mnt apk del syslinux 2>/dev/null sync umount /mnt/boot /mnt/dev /mnt/proc /mnt/sys /mnt 2>/dev/null reboot EOF