Skip to content

Commit 7faaec8

Browse files
committed
refact: trigger-update
1 parent 74f8b4c commit 7faaec8

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

‎system/cuos/api.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ EOF
8888
systemctl restart cuos-app-init.service
8989
fi
9090
;;
91+
"trigger-update")
92+
docker exec cuos-app /api/cuos-trigger-update
93+
R="$?"
94+
# if Container not started or API it not defined, perform cuos update
95+
if [[ "$R" == 1 || "$R" == "126" ]]; then
96+
cuos update
97+
fi
98+
;;
9199

92100
## patch - Patch the current system. Provide config object.
93101
"patch")

‎system/cuos/dialog-maintenance.sh‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,21 +153,11 @@ system_shutdown() {
153153
fi
154154
}
155155

156-
perform_system_update() {
157-
docker exec cuos-app /api/cuos-trigger-update
158-
R="$?"
159-
# if Container not started or API it not defined, perform cuos update
160-
if [[ "$R" == 1 || "$R" == "126" ]]; then
161-
cuos update
162-
fi
163-
}
164-
165156
system_update() {
166157
if ! yesno "Apply the latest system update?\n\nThis may take several minutes and the system may reboot automatically." "System Update" 11 70; then
167158
return
168159
fi
169-
export -f perform_system_update
170-
api_stream "Applying System Update" perform_system_update
160+
api_stream "Applying System Update" cuos trigger-update
171161
}
172162

173163
system_rollback() {

0 commit comments

Comments
 (0)