Commit Diff


commit - 65ef7afb4a8e73e8150e2d1688ddd5850b9b5b02
commit + 155b19e1a79c1ad17269609fd3abdf0db9ce47bc
blob - 1cd07da90131d2bee406196ce9366d6c024392f6
blob + 23d02e49b13e7183f12680c033caf3cbcaa8c6fd
--- _vms.conf
+++ _vms.conf
@@ -8,7 +8,7 @@ IPV6_PREFIX="2a03:6000:9210"
 IPV6_START=9200
 MAC_PREFIX="fe:e1:bb:d4:c3"
 # .conf locations
-VMS="."
+VMS="/home/mischa/Development/vms/vms"
 ETC="."
 IMAGES="."
 HTDOCS="."
blob - be7da4fa9b91b7a8cca73dcc5bc7777aba2fe46f
blob + 2085814844a58d0c9dc13f2946f1ef6591944f88
--- deploy.sh
+++ deploy.sh
@@ -37,6 +37,7 @@ main () {
 
 	date=$(date "+%Y-%m-%d %H:%M:%S")
 	echo "New config files created for $SERVER @ $date"
+	echo "VM definition files in: $VMS"
 
 	fs=$(
 	list_files "$VMS"
@@ -73,7 +74,7 @@ find_vm() {
 	# Find the number of the VM (VM#).
 	# Takes the directory with vm*.txt files and instance
 	# Checks if instance exists otherwise returns the vm filename
-	if _vm=$(find "$1" -type f -name "vm*.txt" -maxdepth 1 | xargs grep -l "$2")
+	if _vm=$(cd "$1" && find . -type f -name "vm*.txt" -maxdepth 1 | xargs grep -l "$2")
 	then echo "$_vm" | sed 's/^\.\/vm//;s/\.txt$//'
 	else echo "$2" | sed 's/^vm//'
 	fi
@@ -118,7 +119,7 @@ check_instance() {
 	# Takes vm*.txt and instance
 	# prints either filename or instance variable
 	if test -z "$2"
-	then echo "$1" | sed 's/^\.\///;s/\.txt$//'
+	then echo "$1" | sed "s@^$VMS@@;s@^/@@;s/\\.txt$//"
 	else echo "$2"
 	fi
 }	
blob - 0dac2995656224eff575dd90c8bd2986c54d5343 (mode 644)
blob + /dev/null
--- vm1.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-instance="vm1instance"
-date="2018/09/18"
-payment=
-donated=
-owner="user1"
-name="User One"
-email="user.one@gmail.com"
-message="ssh-ed25519 AAAAC3NzaC1lAILmSludIBvFRhkxldn1OEgnQdrNd7PxMQjm2DyYCqHjy user1"
-hostname="vm1"
-username="user1"
-note="First!"
blob - /dev/null
blob + 0dac2995656224eff575dd90c8bd2986c54d5343 (mode 644)
--- /dev/null
+++ vms/vm1.txt
@@ -0,0 +1,11 @@
+instance="vm1instance"
+date="2018/09/18"
+payment=
+donated=
+owner="user1"
+name="User One"
+email="user.one@gmail.com"
+message="ssh-ed25519 AAAAC3NzaC1lAILmSludIBvFRhkxldn1OEgnQdrNd7PxMQjm2DyYCqHjy user1"
+hostname="vm1"
+username="user1"
+note="First!"
blob - /dev/null
blob + 9e865e50d02e38a2a095bfc1787cbf4125cee011 (mode 644)
--- /dev/null
+++ vms/vm10.txt
@@ -0,0 +1,9 @@
+date="2018/09/18"
+payment=
+donated=
+name="User Ten"
+email="user.ten@gmail.com"
+message="ssh-ed25519 AAAAC3NzaC1lAILmSludIBvFRhkxldn1OEgnQdrNd7PxMQjm2DyYCqHjy super-special-key"
+hostname="vmten"
+username="userten"
+note="This is all awesome!!"
blob - /dev/null
blob + 19f19d282b678c437f2abffb38aa9afebb8f8b74 (mode 644)
--- /dev/null
+++ vms/vm2.txt
@@ -0,0 +1,11 @@
+instance="vm2instance"
+date="2018/09/18"
+payment=
+donated=
+owner=
+name="User Two"
+email="user.two@gmail.com"
+message="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5SudIBvFRhkxldn1OEgnQdl7PxMQjm2DyYCqHjy"
+hostname="vm2"
+username="user2"
+note="Second!"
blob - /dev/null
blob + 25c225cf1dd7e45d82d39842476737d1cfb0eacd (mode 644)
--- /dev/null
+++ vms/vm3.txt
@@ -0,0 +1,10 @@
+date="2018/09/18"
+payment=
+donated=
+owner="rolf"
+name="User Three"
+email="user.three@gmail.com"
+message="ssh-rsa AAAAB4NzaC1yc2EAAAADAQABAAABAQDZ5LtCgngY6ehDPRA4+hBWl1NtfNNy5++0NjHuVNQgFls4hjdDeouNz1zPL6HXh72PgsBUEoTUucNi8BjOL//qFOCfKiPSJfiGUty+xIjyPowigoDx76z+hOwXVeKJ9sGMmknfH0x1z9Da+ShnNM5r1WwTz5JBV4tlVnQlYX65PeskWJSreTKRoPGSfNU2xxIJePmp0sCTJXfgDooqT7gR8W07vEYfW4pYReJXz4ipD/YBbkAXOxJEa4B75As+K7QC0UgTazq9u7mg+BTuRI9dAybyGqVWG+4EsiVwr57+5yLQkHRsS4JoBZXgyHJQ92o65Tt9eWQZ4DedgTha0d"
+hostname="vmthree.example.com"
+username="userthree"
+note=
blob - /dev/null
blob + e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (mode 644)
blob - /dev/null
blob + 069eabea0eeba9e7e0db3dd4b52dc86d8e7d3bd2 (mode 644)
--- /dev/null
+++ vms/vm5.txt
@@ -0,0 +1,9 @@
+date="2018/09/18"
+payment=
+donated=
+name="User Five"
+email="user.five@gmail.com"
+message="ssh-ed25519 AAAAC3NzaC1lAILmSludIBvFRhkxldn1OEgnQdrNd7PxMQjm2DyYCqHjy user5"
+hostname="vm5"
+username="user5"
+note="This is all awesome!!"
blob - 19f19d282b678c437f2abffb38aa9afebb8f8b74 (mode 644)
blob + /dev/null
--- vm2.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-instance="vm2instance"
-date="2018/09/18"
-payment=
-donated=
-owner=
-name="User Two"
-email="user.two@gmail.com"
-message="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5SudIBvFRhkxldn1OEgnQdl7PxMQjm2DyYCqHjy"
-hostname="vm2"
-username="user2"
-note="Second!"
blob - 25c225cf1dd7e45d82d39842476737d1cfb0eacd (mode 644)
blob + /dev/null
--- vm3.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-date="2018/09/18"
-payment=
-donated=
-owner="rolf"
-name="User Three"
-email="user.three@gmail.com"
-message="ssh-rsa AAAAB4NzaC1yc2EAAAADAQABAAABAQDZ5LtCgngY6ehDPRA4+hBWl1NtfNNy5++0NjHuVNQgFls4hjdDeouNz1zPL6HXh72PgsBUEoTUucNi8BjOL//qFOCfKiPSJfiGUty+xIjyPowigoDx76z+hOwXVeKJ9sGMmknfH0x1z9Da+ShnNM5r1WwTz5JBV4tlVnQlYX65PeskWJSreTKRoPGSfNU2xxIJePmp0sCTJXfgDooqT7gR8W07vEYfW4pYReJXz4ipD/YBbkAXOxJEa4B75As+K7QC0UgTazq9u7mg+BTuRI9dAybyGqVWG+4EsiVwr57+5yLQkHRsS4JoBZXgyHJQ92o65Tt9eWQZ4DedgTha0d"
-hostname="vmthree.example.com"
-username="userthree"
-note=
blob - e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (mode 644)
blob + /dev/null