Add VM/OpenWRT/setup.sh
This commit is contained in:
commit
5d5e62fd2a
25
VM/OpenWRT/setup.sh
Normal file
25
VM/OpenWRT/setup.sh
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/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
|
Loading…
x
Reference in New Issue
Block a user