summarylogtreecommitdiffstats
path: root/open-webui.install
blob: 1d01ad5b839c1490fca438e5d82ce058b7a16a85 (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
post_install() {
    systemd-sysusers open-webui.conf
    systemd-tmpfiles --create open-webui.conf
    echo ">> Enable and start the service:"
    echo ">> systemctl enable --now open-webui"
    echo ">> Then open http://localhost:8080"
}

post_upgrade() {
    echo ">> Restart the service to apply the update:"
    echo ">> systemctl restart open-webui"
}

pre_remove() {
    if systemctl is-active --quiet open-webui.service; then
        echo ">> Stopping open-webui.service before removal..."
        systemctl stop open-webui.service
    fi
    if systemctl is-enabled --quiet open-webui.service; then
        echo ">> Disabling open-webui.service before removal..."
        systemctl disable open-webui.service
    fi
}

post_remove() {
    echo ">> Cleaning up uv cache..."
    rm -rf /var/cache/open-webui

    echo ">> Removing data directory and user..."
    userdel -r open-webui 2>/dev/null

    echo ">> If you want to also remove the app data, run"
    echo ">> rm -rf /var/lib/open-webui"
}