# rget(x-y@2) = x
rget=$(call get,$(call opp,$(1)))
###
+default=$(if $($(1)_$(2)),$($(1)_$(2)),$($(1)))
solve=$(HOST_$(1))
solve_ip=$(IP_$(1))
# can be redefined in conf.mk if that's not the expected behaviour
@echo Created bridge with tap $$(cat $@) on $(call display,$*)
cache/controller.%: cache/bridge.%
- @echo "Setting controller on $(call display,$*) - logs in $(call log,$@)"
- @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs set-controller $(BRIDGE) $(CONTROLLER_$*) &> $(call log,$@) || { rm $@; exit 1; }
+ @echo "Setting controller $(call default,CONTROLLER,$*) on $(call display,$*) - logs in $(call log,$@)"
+ @$(SSH) $(HOST_$*) $(SUDO) ovs-vsctl set-controller $(BRIDGE) $(call default,CONTROLLER,$*) &> $(call log,$@) || { rm $@; exit 1; }
# xxx this probably needs a more thorough cleanup in cache/
cache/stop.%: del-bridge.%
remote-snapshot-links: $(addprefix cache/rsnap.links.,$(CONF_NODE_IDS))
@sort -u /dev/null $^
+### update sliver-ovs
+update: $(addprefix update-,$(CONF_NODE_IDS))
+ @true
+
+update-%: FORCE
+ @[ -n "$(SLIVER_OVS)" ] || { echo "SLIVER_OVS not set" >&2; exit 1; }
+ @[ -f "$(SLIVER_OVS)" ] || { echo "$(SLIVER_OVS) not found" >&2; exit 1; }
+ @echo "Sending $(SLIVER_OVS) to $(call display,$*)"
+ @scp -q $(SLIVER_OVS) $(SLICE)@$(call solve,$*):
+ @$(SSH) $(call solve,$*) $(SUDO) mv $(notdir $(SLIVER_OVS)) /usr/sbin/sliver-ovs
+
.PHONY: remote-snapshot remote-snapshot-ips remote-snapshot-links
cache/rsnap.ip.%:
graph.ps: graph.dot
dot -Tps < $^ > $@
+
####################
# 'virtual' targets in that there's no real file attached
define node_shortcuts