Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Home Assistant - install imagemagick - user script

Featured Replies

For some reason, 'imagemagick' software is not available within 'Home Assistant' container. I need this software for one of Home Assistant components to run.

 

I have added following script to install this software whenever 'HA' updates gets installed. (for now, I want to install when the container is running). But this script is not working. I used Erik Kristensen's 'check_docker_container.sh' script as a base for this.
 

#!/bin/bash

# Author: Erik Kristensen
# Email: [email protected]
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
# checked.
#
# The script checks if a container is running.
#   OK - running
#   WARNING - restarting
#   CRITICAL - stopped
#   UNKNOWN - does not exist
#


# CONTAINER=$1
CONTAINER="home-assistant"
COUNT=300

if [ "x${CONTAINER}" == "x" ]; then
  echo "UNKNOWN - Container ID or Friendly Name Required"
  exit 3
fi

if [ "x$(which docker)" == "x" ]; then
  echo "UNKNOWN - Missing docker binary"
  exit 3
fi

docker info > /dev/null 2>&1
if [ $? -ne 0 ]; then
  echo "UNKNOWN - Unable to talk to the docker daemon"
  exit 3
fi

RESTARTING=$(docker inspect --format="{{.State.Restarting}}" $CONTAINER)

if [ "$RESTARTING" == "true" ]; then
  echo "WARNING - $CONTAINER state is restarting."
  # Wait five minutes
  # echo COUNT $count
  sleep 300
#  exit 1
else
  now=$(date)
  echo $now
  # Wait five minutes
  # echo COUNT $COUNT
  echo "SLEEP FOR 60 SECS"
  #sleep 60
  echo "Installing ImageMagick"
  echo $CONTAINER
  #RUN apk add ImageMagick
  docker exec -i $CONTAINER apk add ImageMagick
  #apk add -no-cache imagemagick
  echo "Completed installing of imagemagick"
  #echo "WARNING - $CONTAINER state is NOT in restarting mode."
  exit 1
fi

STARTED=$(docker inspect --format="{{.State.StartedAt}}" $CONTAINER)
NETWORK=$(docker inspect --format="{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" $CONTAINER)

/usr/local/emhttp/webGui/scripts/notify -i normal -s "OK - $CONTAINER is running." -d "StartedAt: $STARTED"

When I tried to run this script manually, I get this error message. What am I missing in the script?
 

Script location: /tmp/user.scripts/tmpScripts/install imagemagick/script
Note that closing this window will abort the execution of this script
Sat Dec 12 15:48:30 CST 2020
SLEEP FOR 60 SECS
Installing ImageMagick
home-assistant
ImageMagick (missing):
ERROR: unsatisfiable constraints:
required by: world[ImageMagick]
Completed installing of imagemagick

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.