summarylogtreecommitdiffstats
path: root/cellframe-node.install
blob: 5ff8c81c3576cf0a91f28aec9324a6d8b3d26960 (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
39
40
41
42
43
44
45
46
47
48
49
_showmsg() {
BOLD=$(tput bold)
NORMAL=$(tput sgr0)

echo -e "
${BOLD}NODE CONFIGURATION FILES${NORMAL}

    By default, no configuration files are provided. For enabling sane default configuration, run (as root):

    ${BOLD}cellframe-node-config -i /opt/cellframe-node/share/default.setup${NORMAL}

    For enabling diagtool (which is used by Cellframe Dashboard), run (as root):

    ${BOLD}systemctl enable --now cellframe-diagtool.service${NORMAL}
    
${BOLD}STARTING CELLFRAME NODE${NORMAL}

    Use the provided systemd unit file and launch node with cellframe-node-config tool (as root):

    ${BOLD}cellframe-node-config -e service enable${NORMAL}
    ${BOLD}cellframe-node-config -e service start${NORMAL}
    
${BOLD}RUNNING A MASTERNODE${NORMAL}

    View the prerequisites and instructions at:

    ${BOLD}https://wiki.cellframe.net/02.+Learn/Cellframe+Node/Master+Node+Manual+Setup${NORMAL}\n"
}

post_install() {
    _showmsg
}

post_upgrade() {
    echo ":: Executing systemctl daemon-reload..."
    systemctl daemon-reload
    systemctl is-active --quiet cellframe-node.service \
    && echo ":: Restarting cellframe-node.service..." \
    && systemctl restart cellframe-node.service \
    || echo ":: cellframe-node.service not enabled, skipping restart..."
}

pre_remove() {
    systemctl is-active --quiet cellframe-node.service \
    && systemctl stop cellframe-node.service \
    && systemctl disable cellframe-node.service \
    || true
    systemctl daemon-reload
}