summarylogtreecommitdiffstats
path: root/skywire.install
diff options
context:
space:
mode:
Diffstat (limited to 'skywire.install')
-rw-r--r--skywire.install39
1 files changed, 13 insertions, 26 deletions
diff --git a/skywire.install b/skywire.install
index ae29ba942e10..38c627ad9af9 100644
--- a/skywire.install
+++ b/skywire.install
@@ -1,40 +1,27 @@
+pre-install() {
+#kill any instance that was running
+systemctl disable --now skywire.service
+systemctl disable --now skywire-visor.service
+}
+
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 install dir
- cd /opt/skywire/
- #try to reuse old config
- [[ -f /opt/skywire/skywire.json ]] && cp -b /opt/skywire/skywire.json /opt/skywire/skywire.json.gen
- #generate hypervisor configuration
- skywire-cli visor gen-config --is-hypervisor -p -r -o /opt/skywire/skywire.json.gen
- mv /opt/skywire/skywire.json.gen /opt/skywire/skywire.json
- skywire-tls-gen
- systemctl enable --now skywire.service
- echo "Skywire has been configured, starting now on https://127.0.0.1:8000"
- _lanip=$(ifconfig | grep inet | head -n 1)
- _lanip=${_lanip##*inet }
- _lanip=${_lanip%% *}
- echo "Access from local network at: https://${_lanip}:8000"
- _pubkey=$(cat /opt/skywire/skywire.json | grep pk\")
- _pubkey=${_pubkey#*: }
- echo "Visor Public Key: ${_pubkey}"
- echo "run keypkg-gen to generate the distributable public key package"
+skywire-autoconfig
}
-#pre-upgrade() {
-#}
+pre-upgrade() {
+pre-install
+}
post_upgrade() {
post_install
}
pre-remove() {
- systemctl disable --now skywire.service
- systemctl disable --now skywire-visor.service
+systemctl disable --now skywire.service
+systemctl disable --now skywire-visor.service
}
post_remove() {
+#remove possibly dangling configs so as not to interfere with future installs
rm -rf /opt/skywire
}