Skip to content

Commit

Permalink
check_if_installed -> pkg_installed
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitry-ishenko committed Dec 14, 2024
1 parent 3fa63ec commit bce1651
Show file tree
Hide file tree
Showing 28 changed files with 57 additions and 65 deletions.
6 changes: 3 additions & 3 deletions tools/modules/functions/check_desktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ function check_desktop() {

DISPLAY_MANAGER=""
DESKTOP_INSTALLED=""
check_if_installed nodm && DESKTOP_INSTALLED="nodm"
check_if_installed lightdm && DESKTOP_INSTALLED="lightdm"
check_if_installed lightdm && DESKTOP_INSTALLED="gnome"
pkg_installed nodm && DESKTOP_INSTALLED="nodm"
pkg_installed lightdm && DESKTOP_INSTALLED="lightdm"
pkg_installed lightdm && DESKTOP_INSTALLED="gnome"
[[ -n $(service lightdm status 2> /dev/null | grep -w active) ]] && DISPLAY_MANAGER="lightdm"
[[ -n $(service nodm status 2> /dev/null | grep -w active) ]] && DISPLAY_MANAGER="nodm"
[[ -n $(service gdm status 2> /dev/null | grep -w active) ]] && DISPLAY_MANAGER="gdm"
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_bazarr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_bazarr () {
local title="bazarr"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/bazarr?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/bazarr?( |$)/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_bazarr () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$BAZARR_BASE" ]] || mkdir -p "$BAZARR_BASE" || { echo "Couldn't create storage directory: $BAZARR_BASE"; exit 1; }
docker run -d \
--name=bazarr \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_deluge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_deluge () {
local title="deluge"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/deluge?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/deluge?( |$)/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_deluge () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$DELUGE_BASE" ]] || mkdir -p "$DELUGE_BASE" || { echo "Couldn't create storage directory: $DELUGE_BASE"; exit 1; }
docker run -d \
--name=deluge \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_haos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module_haos() {



if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/home-assistant/{print $1}')
local image=$(docker image ls -a | mawk '/home-assistant/{print $3}')
fi
Expand All @@ -38,7 +38,7 @@ module_haos() {
echo
;;
install)
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker

# this hack will allow running it on minimal image, but this has to be done properly in the network section, to allow easy switching
systemctl disable systemd-networkd
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_jellyseerr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_jellyseerr () {
local title="jellyseerr"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/jellyseerr?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/jellyseerr?( |$)/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_jellyseerr () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$JELLYSEERR_BASE" ]] || mkdir -p "$JELLYSEERR_BASE" || { echo "Couldn't create storage directory: $JELLYSEERR_BASE"; exit 1; }
docker run -d \
--name jellyseerr \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_lidarr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_lidarr () {
local title="lidarr"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/lidarr?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/lidarr?( |$)/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_lidarr () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$LIDARR_BASE" ]] || mkdir -p "$LIDARR_BASE" || { echo "Couldn't create storage directory: $LIDARR_BASE"; exit 1; }
docker run -d \
--name=lidarr \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_mariadb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function module_mariadb () {
local title="mariadb"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/mariadb?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/mariadb?( |$)/{print $3}')
fi
Expand All @@ -28,7 +28,7 @@ function module_mariadb () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$MARIADB_BASE" ]] || mkdir -p "$MARIADB_BASE" || { echo "Couldn't create storage directory: $MARIADB_BASE"; exit 1; }

# get parameters
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_medusa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function module_medusa () {
local title="Medusa"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/medusa?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/medusa?( |$)/{print $3}')
fi
Expand All @@ -27,7 +27,7 @@ function module_medusa () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$MEDUSA_BASE" ]] || mkdir -p "$MEDUSA_BASE" || { echo "Couldn't create storage directory: $MEDUSA_BASE"; exit 1; }
docker run -d \
--name=medusa \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_netdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_netdata () {
local title="netdata"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/netdata?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/netdata?( |$)/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_netdata () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$NETDATA_BASE" ]] || mkdir -p "$NETDATA_BASE" || { echo "Couldn't create storage directory: $NETDATA_BASE"; exit 1; }
docker run -d --name=netdata \
--pid=host \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function module_nextcloud () {
local title="nextcloud"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/nextcloud?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/nextcloud?( |$)/{print $3}')
fi
Expand All @@ -28,7 +28,7 @@ function module_nextcloud () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$NEXTCLOUD_BASE" ]] || mkdir -p "$NEXTCLOUD_BASE" || { echo "Couldn't create storage directory: $NEXTCLOUD_BASE"; exit 1; }
docker run -d \
--name=nextcloud \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_owncloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_owncloud () {
local title="owncloud"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/owncloud?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/owncloud/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_owncloud () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$OWNCLOUD_BASE" ]] || mkdir -p "$OWNCLOUD_BASE" || { echo "Couldn't create storage directory: $OWNCLOUD_BASE"; exit 1; }
docker run -d \
--name=owncloud \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_phpmyadmin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function module_phpmyadmin () {
local title="phpmyadmin"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/phpmyadmin?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/phpmyadmin?( |$)/{print $3}')
fi
Expand All @@ -28,7 +28,7 @@ function module_phpmyadmin () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$PHPMYADMIN_BASE" ]] || mkdir -p "$PHPMYADMIN_BASE" || { echo "Couldn't create storage directory: $PHPMYADMIN_BASE"; exit 1; }
docker run -d \
--name=phpmyadmin \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_pi-hole.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module_options+=(
#
function pi_hole () {

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/pihole?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/pihole?( |$)/{print $3}')
fi
Expand All @@ -39,7 +39,7 @@ function pi_hole () {
;;
install)

check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker

# disable dns within systemd-resolved
if systemctl is-active --quiet systemd-resolved.service && ! grep -q "^DNSStubListener=no" /etc/systemd/resolved.conf; then
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_portainer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module_options+=(
#
module_portainer() {

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $3}')
fi
Expand All @@ -36,7 +36,7 @@ module_portainer() {
echo
;;
install)
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
docker volume ls -q | grep -xq 'portainer_data' || docker volume create portainer_data
docker run -d \
-p '9000:9000' \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_prowlarr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_prowlarr () {
local title="prowlarr"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/prowlarr?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/prowlarr?( |$)/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_prowlarr () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$PROWLARR_BASE" ]] || mkdir -p "$PROWLARR_BASE" || { echo "Couldn't create storage directory: $PROWLARR_BASE"; exit 1; }
docker run -d \
--name=prowlarr \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_qbittorrent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module_options+=(
#
function module_qbittorrent () {

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/qbittorrent?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/qbittorrent?( |$)/{print $3}')
fi
Expand All @@ -25,7 +25,7 @@ function module_qbittorrent () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$QBITTORRENT_BASE" ]] || mkdir -p "$QBITTORRENT_BASE" || { echo "Couldn't create storage directory: $QBITTORRENT_BASE"; exit 1; }
docker run -d \
--name=qbittorrent \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_radarr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_radarr () {
local title="radarr"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/radarr?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/radarr?( |$)/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_radarr () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$RADARR_BASE" ]] || mkdir -p "$RADARR_BASE" || { echo "Couldn't create storage directory: $RADARR_BASE"; exit 1; }
docker run -d \
--name=radarr \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_readarr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_readarr () {
local title="readarr"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/readarr?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/readarr?( |$)/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_readarr () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$READARR_BASE" ]] || mkdir -p "$READARR_BASE" || { echo "Couldn't create storage directory: $READARR_BASE"; exit 1; }
docker run -d \
--name=readarr \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_sabnzbd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_sabnzbd () {
local title="Sabnzbd"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/sabnzbd?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/sabnzbd?( |$)/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_sabnzbd () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$SABNZBD_BASE" ]] || mkdir -p "$SABNZBD_BASE" || { echo "Couldn't create storage directory: $SABNZBD_BASE"; exit 1; }
docker run -d \
--name=sabnzbd \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_sonarr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function module_sonarr () {
local title="sonarr"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/sonarr?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/sonarr?( |$)/{print $3}')
fi
Expand All @@ -26,7 +26,7 @@ function module_sonarr () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$SONARR_BASE" ]] || mkdir -p "$SONARR_BASE" || { echo "Couldn't create storage directory: $SONARR_BASE"; exit 1; }
docker run -d \
--name=sonarr \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_stirling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function module_stirling () {
local title="stirling"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/stirling-pdf?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/stirling-pdf?( |$)/{print $3}')
fi
Expand All @@ -28,7 +28,7 @@ function module_stirling () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$STIRLING_BASE" ]] || mkdir -p "$STIRLING_BASE" || { echo "Couldn't create storage directory: $STIRLING_BASE"; exit 1; }
docker run -d \
-p 8077:8080 \
Expand Down
4 changes: 2 additions & 2 deletions tools/modules/software/install_syncthing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function module_syncthing () {
local title="syncthing"
local condition=$(which "$title" 2>/dev/null)

if check_if_installed docker-ce; then
if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/syncthing?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/syncthing?( |$)/{print $3}')
fi
Expand All @@ -28,7 +28,7 @@ function module_syncthing () {

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
pkg_installed docker-ce || install_docker
[[ -d "$SYNCTHING_BASE" ]] || mkdir -p "$SYNCTHING_BASE" || { echo "Couldn't create storage directory: $SYNCTHING_BASE"; exit 1; }
docker run -d \
--name=syncthing \
Expand Down
Loading

0 comments on commit bce1651

Please sign in to comment.