Use dpkg for architecture detection (#1481)

This commit is contained in:
DesktopECHO 2022-08-25 08:13:02 -03:00 committed by GitHub
parent c072a9c4d7
commit c41d38aa2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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