26 lines
795 B
Bash
26 lines
795 B
Bash
#!/bin/bash
|
|
# ____ _ _
|
|
#/ ___|| |_| |__ ___ _ __ ___
|
|
#\___ \| __| '_ \ / _ \| '_ \ / _ \
|
|
# ___) | |_| | | | (_) | |_) | __/
|
|
#|____/ \__|_| |_|\___/| .__/ \___|
|
|
# |_|
|
|
#
|
|
regex='<strong>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
|