summarylogtreecommitdiffstats
path: root/webvirtd.install
blob: e0ab41518b1549161f8220d5617e2ba618530f45 (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
34
35
36
37
38
#!/bin/bash
ssh_path=/var/lib/webvirt/.ssh

post_install() {
  if [ ! -f ${ssh_path}/id_ecdsa ]; then
    sudo -u webvirt mkdir -p $ssh_path
    sudo -u webvirt ssh-keygen -t ecdsa -N '' -f ${ssh_path}/id_ecdsa

cat << EOF
webvirtd ssh keys have been generated.

1. Copy ${ssh_path}/id_ecdsa.pub to /etc/ssh/authorized_keys
2. Put 'AuthorizedKeysFile /etc/ssh/authorized_keys .ssh/authorized_keys' in /etc/ssh/sshd_config
3. Run 'systemctl restart sshd'
EOF
  fi

cat << EOF

NOTE: Users accessing webvirtd must be added to the 'webvirt' group.

To start webvirtd, utilize its systemd service:

  # systemctl start webvirtd.service

By default, webvirtd's API is accessible at /var/run/webvirtd/webvirtd.sock.

EOF
}

post_upgrade() {
  post_install $1
}
 
op=$1
shift
 
$op $*