|
2 | 2 | source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) |
3 | 3 |
|
4 | 4 | # Copyright (c) 2021-2026 community-scripts ORG |
5 | | -# Author: MickLesk (CanbiZ) |
| 5 | +# Author: MickLesk (CanbiZ) | Co-Author: Tom Frenzel (tomfrenzel) |
6 | 6 | # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE |
7 | 7 | # Source: https://openthread.io/guides/border-router |
8 | 8 |
|
@@ -32,29 +32,23 @@ function update_script() { |
32 | 32 | exit |
33 | 33 | fi |
34 | 34 |
|
35 | | - cd /opt/ot-br-posix |
36 | | - LOCAL_COMMIT=$(git rev-parse HEAD) |
37 | | - $STD git fetch --depth 1 origin main |
38 | | - REMOTE_COMMIT=$(git rev-parse origin/main) |
| 35 | + if check_for_gh_release "openthread-br" "openthread/ot-br-posix"; then |
| 36 | + msg_info "Stopping Services" |
| 37 | + systemctl stop otbr-web |
| 38 | + systemctl stop otbr-agent |
| 39 | + msg_ok "Stopped Services" |
39 | 40 |
|
40 | | - if [[ "${LOCAL_COMMIT}" == "${REMOTE_COMMIT}" ]]; then |
41 | | - msg_ok "Already up to date (${LOCAL_COMMIT:0:7})" |
42 | | - exit |
43 | | - fi |
44 | | - |
45 | | - msg_info "Stopping Services" |
46 | | - systemctl stop otbr-web |
47 | | - systemctl stop otbr-agent |
48 | | - msg_ok "Stopped Services" |
| 41 | + msg_info "Backing up Configuration" |
| 42 | + cp /etc/default/otbr-agent /etc/default/otbr-agent.bak |
| 43 | + msg_ok "Backed up Configuration" |
49 | 44 |
|
50 | | - msg_info "Backing up Configuration" |
51 | | - cp /etc/default/otbr-agent /etc/default/otbr-agent.bak |
52 | | - msg_ok "Backed up Configuration" |
53 | | - |
54 | | - msg_info "Updating Source" |
55 | | - $STD git reset --hard origin/main |
56 | | - $STD git submodule update --depth 1 --init --recursive |
57 | | - msg_ok "Updated Source" |
| 45 | + msg_info "Fetching GitHub release OpenThread-BR (${CHECK_UPDATE_RELEASE#v})" |
| 46 | + cd /opt/ot-br-posix |
| 47 | + $STD git fetch --depth 1 origin tag "$CHECK_UPDATE_RELEASE" |
| 48 | + $STD git checkout -f "$CHECK_UPDATE_RELEASE" |
| 49 | + $STD git submodule update --depth 1 --init --recursive |
| 50 | + echo "${CHECK_UPDATE_RELEASE#v}" > ~/.openthread-br |
| 51 | + msg_ok "Deployed GitHub release OpenThread-BR (${CHECK_UPDATE_RELEASE#v})" |
58 | 52 |
|
59 | 53 | msg_info "Rebuilding OpenThread Border Router (Patience)" |
60 | 54 | cd /opt/ot-br-posix/build |
|
104 | 98 | systemctl start otbr-web |
105 | 99 | msg_ok "Started Services" |
106 | 100 | msg_ok "Updated successfully!" |
| 101 | + fi |
107 | 102 | exit |
108 | 103 | } |
109 | 104 |
|
|
0 commit comments