post_install() { #kill any instance that was running systemctl disable --now skywire.service systemctl disable --now skywire-visor.service #config generation writes in the current dir; #so we want to make anything spawned by the process appear as a subdirectory of /root cd ~/ #try to reuse old config [[ -f /opt/skywire/skywire.json ]] && cp -b /opt/skywire/skywire.json ~/skywire.json #generate hypervisor configuration skywire-cli visor gen-config --is-hypervisor -p -r -o skywire.json mv skywire.json /opt/skywire/skywire.json skywire-tls-gen echo "Skywire has been configured, starting now on https://127.0.0.1:8000" systemctl enable --now skywire.service echo "run keypkg-gen to generate the distributable public key package" } #pre-upgrade() { #} post_upgrade() { post_install } pre-remove() { systemctl disable --now skywire.service systemctl disable --now skywire-visor.service } post_remove() { rm -rf /opt/skywire }