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
43
44
45
46
47
#!/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 abortInstall() {
    purge
}
 
function deleteUser() {
    if grep -q "^${WEBODM_USER}:" /etc/passwd; then
        userdel "${WEBODM_USER}"
    fi
}
 
function deleteUserHome() {
    if [ -d "${WEBODM_USER_HOME}" ]; then
        rm -Rf "${WEBODM_USER_HOME}"
    fi
}
 
function purge() {
    stopService
    deleteUser
    deleteUserHome
}
 
 
case $1 in
    abort-install)
        abortInstall
        ;;
    remove)
        exit 0
        ;;
    purge)
        purge
        ;;
    default)
        exit 1
        ;;
esac