Upstart file and startup script for vcpe
diff --git a/xos/observers/vcpe/files/vcpe.conf b/xos/observers/vcpe/files/vcpe.conf
new file mode 100644
index 0000000..752c57a
--- /dev/null
+++ b/xos/observers/vcpe/files/vcpe.conf
@@ -0,0 +1,10 @@
+# Upstart script for vCPE
+description "vCPE container"
+author "andy@onlab.us"
+start on filesystem and started docker
+stop on runlevel [!2345]
+respawn
+
+script
+ /usr/local/sbin/start-vcpe.sh
+end script
diff --git a/xos/observers/vcpe/templates/start-vcpe.sh.j2 b/xos/observers/vcpe/templates/start-vcpe.sh.j2
new file mode 100755
index 0000000..ff23b75
--- /dev/null
+++ b/xos/observers/vcpe/templates/start-vcpe.sh.j2
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+iptables -L > /dev/null
+ip6tables -L > /dev/null
+
+docker inspect vcpe > /dev/null 2>&1
+if [ "$?" == 1 ]
+then
+ docker run --name=vcpe --privileged=true --net=none andybavier/docker-vcpe
+else
+ docker start vcpe
+fi
+
+# Set up networking via pipework
+docker exec vcpe ifconfig eth0 >> /dev/null || pipework eth3 -i eth0 vcpe 10.1.2.99/24
+docker exec vcpe ifconfig eth1 >> /dev/null || pipework eth2 -i eth1 vcpe 192.168.0.1/24 @{{ vlan_ids[0] }}
+
+# Now can start up dnsmasq
+docker exec vcpe service dnsmasq start
+
+# Attach to container
+docker start -a vcpe