summarylogtreecommitdiffstats
path: root/skywire.install
blob: 6c5392731be633a0cd475c09727044a0429d4f87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
}