From cbf6d4141ed2761ae3c688e7d59fe19e8a72ac0d Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Tue, 2 Jun 2020 14:36:00 +0200 Subject: [PATCH] [FreeBSD] Add VM create script --- FreeBSD/vcreate.csh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 FreeBSD/vcreate.csh diff --git a/FreeBSD/vcreate.csh b/FreeBSD/vcreate.csh new file mode 100644 index 0000000..2e38b35 --- /dev/null +++ b/FreeBSD/vcreate.csh @@ -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