commit 5d5e62fd2a5518b66f754416a3dc0cf4de8fe1ee Author: Sthope Date: Tue Jul 25 23:50:41 2023 +0200 Add VM/OpenWRT/setup.sh diff --git a/VM/OpenWRT/setup.sh b/VM/OpenWRT/setup.sh new file mode 100644 index 0000000..d369db0 --- /dev/null +++ b/VM/OpenWRT/setup.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# ____ _ _ +#/ ___|| |_| |__ ___ _ __ ___ +#\___ \| __| '_ \ / _ \| '_ \ / _ \ +# ___) | |_| | | | (_) | |_) | __/ +#|____/ \__|_| |_|\___/| .__/ \___| +# |_| +# +regex='Current Stable Release - OpenWrt ([^/]*)<\/strong>' && response=$(curl -s https://openwrt.org) && [[ $response =~ $regex ]] && stableVersion="${BASH_REMATCH[1]}" + +wget -O openwrt.img.gz https://downloads.openwrt.org/releases/$stableVersion/targets/x86/64/openwrt-$stableVersion-x86-64-generic-ext4-combined.img.gz + +gunzip ./openwrt.img.gz + +mv ./openwrt*.img ./openwrt.raw + +qemu-img resize -f raw ./openwrt.raw 512M + +echo "What Storage do you want to use? eg: local" +read -p "Enter your choice: " what_storage + +qm importdisk 123 openwrt.raw $what_storage + +# Exit the script. +exit 0