Update qmcreate.sh
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
while read $line
|
while read line
|
||||||
do
|
do
|
||||||
#echo $line
|
#echo $line
|
||||||
ip=$(echo $line | cut -d ' ' -f 1)
|
ip=$(echo $line | cut -d ' ' -f 1)
|
||||||
@@ -20,7 +20,7 @@ do
|
|||||||
sed -i "s/HOSTNAME/$hostname/g" /mnt/pve/syno-tigra/snippets/${vmnum}_user.yaml
|
sed -i "s/HOSTNAME/$hostname/g" /mnt/pve/syno-tigra/snippets/${vmnum}_user.yaml
|
||||||
sed -i "s/IP/$ip/g" /mnt/pve/syno-tigra/snippets/${vmnum}_network.yaml
|
sed -i "s/IP/$ip/g" /mnt/pve/syno-tigra/snippets/${vmnum}_network.yaml
|
||||||
mac=$(cat /etc/pve/qemu-server/${vmnum}.conf | grep net0 | cut -d ',' -f 1 | cut -d '=' -f 2)
|
mac=$(cat /etc/pve/qemu-server/${vmnum}.conf | grep net0 | cut -d ',' -f 1 | cut -d '=' -f 2)
|
||||||
sed -i sed -i "s/IP/$mac/g" /mnt/pve/syno-tigra/snippets/${vmnum}_network.yaml
|
sed -i "s/MAC/$mac/g" /mnt/pve/syno-tigra/snippets/${vmnum}_network.yaml
|
||||||
if [ -f "./gfx.pub "]
|
if [ -f "./gfx.pub "]
|
||||||
then echo "key OK"
|
then echo "key OK"
|
||||||
else echo "key ERROR. Put the public key named 'gfx.pub'"; exit 2
|
else echo "key ERROR. Put the public key named 'gfx.pub'"; exit 2
|
||||||
|
|||||||
Reference in New Issue
Block a user