Skip to content

Commit c41d38a

Browse files
authored
Use dpkg for architecture detection (#1481)
1 parent c072a9c commit c41d38a

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

bin/ncp-update-nc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ else
194194
apachectl -k graceful
195195
## make sure the notify_push daemon is runnnig
196196

197-
arch="$(uname -m)"
198-
[[ "${arch}" =~ "armv7" ]] && arch="armv7"
197+
arch="$(dpkg --print-architecture)"
198+
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
199199
cat > /etc/systemd/system/notify_push.service <<EOF
200200
[Unit]
201201
Description = Push daemon for Nextcloud clients

bin/ncp/CONFIG/nc-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ EOF
152152
ncc app:disable updatenotification
153153

154154
# News dropped support for 32-bit -> https://github.com/nextcloud/news/issues/1423
155-
if ! [[ "$(uname -m)" =~ "armv7" ]]; then
155+
if ! [[ "$(dpkg --print-architecture)" =~ ^(armhf|arm)$ ]]; then
156156
ncc app:install news
157157
ncc app:enable news
158158
fi

etc/library.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ function start_notify_push
164164
pgrep notify_push &>/dev/null && return
165165
if [[ -f /.docker-image ]]; then
166166
local arch
167-
arch="$(uname -m)"
168-
[[ "${arch}" =~ "armv7" ]] && arch="armv7"
167+
arch="$(dpkg --print-architecture)"
168+
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
169169
NEXTCLOUD_URL=https://localhost sudo -E -u www-data /var/www/nextcloud/apps/notify_push/bin/"${arch}"/notify_push --allow-self-signed /var/www/nextcloud/config/config.php &>/dev/null &
170170
else
171171
systemctl enable --now notify_push

updates/1.43.0.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ install_app nc-restore
3535
[[ ! -f /.docker-image ]] && {
3636

3737
# fix HPB with dynamic public IP
38-
arch="$(uname -m)"
39-
[[ "${arch}" =~ "armv7" ]] && arch="armv7"
38+
arch="$(dpkg --print-architecture)"
39+
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
4040
cat > /etc/systemd/system/notify_push.service <<EOF
4141
[Unit]
4242
Description = Push daemon for Nextcloud clients

0 commit comments

Comments
 (0)