Skip to content

Commit

Permalink
Use dpkg for architecture detection (#1481)
Browse files Browse the repository at this point in the history
  • Loading branch information
DesktopECHO authored Aug 25, 2022
1 parent c072a9c commit c41d38a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bin/ncp-update-nc
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ else
apachectl -k graceful
## make sure the notify_push daemon is runnnig

arch="$(uname -m)"
[[ "${arch}" =~ "armv7" ]] && arch="armv7"
arch="$(dpkg --print-architecture)"
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
cat > /etc/systemd/system/notify_push.service <<EOF
[Unit]
Description = Push daemon for Nextcloud clients
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/CONFIG/nc-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ EOF
ncc app:disable updatenotification

# News dropped support for 32-bit -> https://github.com/nextcloud/news/issues/1423
if ! [[ "$(uname -m)" =~ "armv7" ]]; then
if ! [[ "$(dpkg --print-architecture)" =~ ^(armhf|arm)$ ]]; then
ncc app:install news
ncc app:enable news
fi
Expand Down
4 changes: 2 additions & 2 deletions etc/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ function start_notify_push
pgrep notify_push &>/dev/null && return
if [[ -f /.docker-image ]]; then
local arch
arch="$(uname -m)"
[[ "${arch}" =~ "armv7" ]] && arch="armv7"
arch="$(dpkg --print-architecture)"
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
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 &
else
systemctl enable --now notify_push
Expand Down
4 changes: 2 additions & 2 deletions updates/1.43.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ install_app nc-restore
[[ ! -f /.docker-image ]] && {

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

0 comments on commit c41d38a

Please sign in to comment.