[FreeBSD] Add VM create script

This commit is contained in:
Simon Cornet 2020-06-02 14:36:00 +02:00
parent c38b319c3d
commit cbf6d4141e

25
FreeBSD/vcreate.csh Normal file
View File

@ -0,0 +1,25 @@
#!/bin/csh -f
set HOSTNAME=$1
set IP=$2
# set static variables
set VM=/usr/local/sbin/vm
set TEMPLATE=ubuntu-small
set IMAGE=ubuntu20.img
set PUBKEY=/home/simon/.ssh/id_ed25519.pub
set NAMESERVER=192.168.10.254
set GATEWAY=192.168.10.254
if ( $3 == "" ) then
set SIZE=20G
else
set SIZE=$3
endif
$VM create \
-t $TEMPLATE \
-s $SIZE \
-i $IMAGE \
-C -k $PUBKEY \
-n "ip=$IP/24;gateway=$GATEWAY;nameservers=$NAMESERVER" \
$HOSTNAME