zhongrj
2025-11-25 b89962006164a462404b79a738bee8cbb6d7fe7e
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
#!/usr/bin/env bash
 
set -euxo
 
export WEBODM_VERSION=1.9.7
export WEBODM_USER=odm
export WEBODM_USER_HOME="/home/${WEBODM_USER}"
export WEBODM_DIR=/opt/WebODM
export WEBODM_VENV_DIR="${WEBODM_DIR}/python3-venv"
 
function remove() {
    stopService
}
 
function stopService() {
    UNIT_NAME="webodm-docker.service"
    set +e
 
    systemctl is-active -q "${UNIT_NAME}"
    if [ "${?}" -eq 1 ]; then
        set -e
        systemctl stop "${UNIT_NAME}"
        systemctl disable "${UNIT_NAME}"
    else
        set -e
    fi
 
    systemctl daemon-reload
 
    if [ -f "${WEBODM_DIR}/webodm.sh" ]; then
        "${WEBODM_DIR}/webodm.sh" down
    fi
}
 
case $1 in
    remove)
        remove
        ;;
    default)
        exit 1
        ;;
esac