openWRT.sh 845 B

12345678910111213141516
  1. #!/bin/bash
  2. rm -rf ./openwrt-*
  3. #wget -c https://downloads.openwrt.org/releases/23.05.4/targets/x86/64/openwrt-23.05.4-x86-64-generic-squashfs-rootfs.img.gz
  4. wget -c https://downloads.openwrt.org/snapshots/targets/x86/64/openwrt-x86-64-generic-squashfs-rootfs.img.gz
  5. gzip -d openwrt-*-generic-squashfs-rootfs.img.gz
  6. unsquashfs openwrt-*-generic-squashfs-rootfs.img
  7. apt install squashfs-tools
  8. unsquashfs openwrt-*-generic-squashfs-rootfs.img
  9. cd squashfs-root/
  10. tar -czf ../openwrt-x86-64-generic-squashfs-rootfs.tar.gz *
  11. cd ..
  12. cp openwrt-x86-64-generic-squashfs-rootfs.tar.gz /var/lib/vz/template/cache/
  13. pct create 100 local:vztmpl/openwrt-x86-64-generic-squashfs-rootfs.tar.gz --rootfs local:1 --ostype unmanaged --hostname OpenWrtAll --arch amd64 --cores 2 --memory 1024 --swap 0 -net0 bridge=vmbr0,name=eth0