scripts/FreeBSD/vm/vcreate.csh

36 lines
696 B
Tcsh
Raw Normal View History

2020-06-02 14:36:00 +02:00
#!/bin/csh -f
2020-06-02 15:09:46 +02:00
# set arguments
2020-06-02 14:36:00 +02:00
set HOSTNAME=$1
set IP=$2
2020-06-02 15:09:46 +02:00
if ( $3 == "" ) then
set SIZE=20G
else
set SIZE=$3
endif
2020-06-02 14:36:00 +02:00
# 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
2021-02-10 18:40:29 +01:00
<<<<<<< HEAD
=======
2020-08-13 15:18:28 +02:00
set PREFIX=24
2021-02-10 18:40:29 +01:00
>>>>>>> 93e0bfb4f86673a87465d127972c447d7c48cfc0
2020-06-02 14:36:00 +02:00
2020-06-02 15:09:46 +02:00
# create vm
2020-06-02 14:36:00 +02:00
$VM create \
-t $TEMPLATE \
-s $SIZE \
-i $IMAGE \
-C -k $PUBKEY \
2021-02-10 18:40:29 +01:00
<<<<<<< HEAD
2020-06-02 14:36:00 +02:00
-n "ip=$IP/24;gateway=$GATEWAY;nameservers=$NAMESERVER" \
2021-02-10 18:40:29 +01:00
=======
2020-08-13 15:18:28 +02:00
-n "ip=$IP/$PREFIX;gateway=$GATEWAY;nameservers=$NAMESERVER" \
2021-02-10 18:40:29 +01:00
>>>>>>> 93e0bfb4f86673a87465d127972c447d7c48cfc0
2020-06-02 14:36:00 +02:00
$HOSTNAME