From 1789b71734d0e71cc7f40b542e1c410acb00d61c Mon Sep 17 00:00:00 2001 From: Duncan Hill Date: Tue, 7 Jan 2025 18:31:14 +0000 Subject: [PATCH] Make core dependencies a function, update sample installers to use it --- install/alpine-docker-install.sh | 6 +----- install/alpine-grafana-install.sh | 9 +-------- install/alpine-install.sh | 9 +-------- install/alpine-nextcloud-install.sh | 6 +----- install/alpine-vaultwarden-install.sh | 6 +----- install/alpine-zigbee2mqtt-install.sh | 9 +-------- install/debian-install.sh | 7 +------ install/ubuntu-install.sh | 7 +------ misc/alpine-install.func | 8 ++++++++ misc/install.func | 10 ++++++++++ 10 files changed, 26 insertions(+), 51 deletions(-) diff --git a/install/alpine-docker-install.sh b/install/alpine-docker-install.sh index cd70c6f0..6962873b 100644 --- a/install/alpine-docker-install.sh +++ b/install/alpine-docker-install.sh @@ -12,14 +12,10 @@ catch_errors setting_up_container network_check update_os +install_core_dependencies msg_info "Installing Dependencies" -$STD apk add newt -$STD apk add curl -$STD apk add openssh $STD apk add tzdata -$STD apk add nano -$STD apk add mc msg_ok "Installed Dependencies" msg_info "Installing Docker" diff --git a/install/alpine-grafana-install.sh b/install/alpine-grafana-install.sh index d6b59ef6..1b2f409f 100644 --- a/install/alpine-grafana-install.sh +++ b/install/alpine-grafana-install.sh @@ -12,14 +12,7 @@ catch_errors setting_up_container network_check update_os - -msg_info "Installing Dependencies" -$STD apk add newt -$STD apk add curl -$STD apk add openssh -$STD apk add nano -$STD apk add mc -msg_ok "Installed Dependencies" +install_core_dependencies msg_info "Installing Grafana" $STD apk add grafana diff --git a/install/alpine-install.sh b/install/alpine-install.sh index 83999eb6..199e1516 100644 --- a/install/alpine-install.sh +++ b/install/alpine-install.sh @@ -12,14 +12,7 @@ catch_errors setting_up_container network_check update_os - -msg_info "Installing Dependencies" -$STD apk add newt -$STD apk add curl -$STD apk add openssh -$STD apk add nano -$STD apk add mc -msg_ok "Installed Dependencies" +install_core_dependencies motd_ssh customize diff --git a/install/alpine-nextcloud-install.sh b/install/alpine-nextcloud-install.sh index 7f337a05..da5224a9 100644 --- a/install/alpine-nextcloud-install.sh +++ b/install/alpine-nextcloud-install.sh @@ -12,14 +12,10 @@ catch_errors setting_up_container network_check update_os +install_core_dependencies msg_info "Installing Dependencies" -$STD apk add newt -$STD apk add curl $STD apk add openssl -$STD apk add openssh -$STD apk add nano -$STD apk add mc $STD apk add nginx msg_ok "Installed Dependencies" diff --git a/install/alpine-vaultwarden-install.sh b/install/alpine-vaultwarden-install.sh index c3a93490..49dd79eb 100644 --- a/install/alpine-vaultwarden-install.sh +++ b/install/alpine-vaultwarden-install.sh @@ -12,14 +12,10 @@ catch_errors setting_up_container network_check update_os +install_core_dependencies msg_info "Installing Dependencies" -$STD apk add newt -$STD apk add curl $STD apk add openssl -$STD apk add openssh -$STD apk add nano -$STD apk add mc $STD apk add argon2 msg_ok "Installed Dependencies" diff --git a/install/alpine-zigbee2mqtt-install.sh b/install/alpine-zigbee2mqtt-install.sh index 7c294388..2e3b3f8a 100644 --- a/install/alpine-zigbee2mqtt-install.sh +++ b/install/alpine-zigbee2mqtt-install.sh @@ -12,14 +12,7 @@ catch_errors setting_up_container network_check update_os - -msg_info "Installing Dependencies" -$STD apk add newt -$STD apk add curl -$STD apk add openssh -$STD apk add nano -$STD apk add mc -msg_ok "Installed Dependencies" +install_core_dependencies msg_info "Installing Alpine-Zigbee2MQTT" $STD apk add zigbee2mqtt diff --git a/install/debian-install.sh b/install/debian-install.sh index 20971451..bed8876c 100644 --- a/install/debian-install.sh +++ b/install/debian-install.sh @@ -12,12 +12,7 @@ catch_errors setting_up_container network_check update_os - -msg_info "Installing Dependencies" -$STD apt-get install -y curl -$STD apt-get install -y sudo -$STD apt-get install -y mc -msg_ok "Installed Dependencies" +install_core_dependencies motd_ssh customize diff --git a/install/ubuntu-install.sh b/install/ubuntu-install.sh index 7d58cdaa..29ad16a4 100644 --- a/install/ubuntu-install.sh +++ b/install/ubuntu-install.sh @@ -12,12 +12,7 @@ catch_errors setting_up_container network_check update_os - -msg_info "Installing Dependencies" -$STD apt-get install -y curl -$STD apt-get install -y sudo -$STD apt-get install -y mc -msg_ok "Installed Dependencies" +install_core_dependencies motd_ssh customize diff --git a/misc/alpine-install.func b/misc/alpine-install.func index 4a9a655c..f50c95c6 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -133,6 +133,14 @@ update_os() { msg_ok "Updated Container OS" } +# Install core packages that (almost) every container will depend upon. +# Be sure to update install.func for apt-based systems as appropriate. +install_core_dependencies() { + msg_info "Installing core dependencies" + $STD apk add curl mc nano newt openssh sudo + msg_ok "Installed core dependencies" +} + # This function modifies the message of the day (motd) and SSH settings motd_ssh() { # Set terminal to 256-color mode diff --git a/misc/install.func b/misc/install.func index 1a3cf5eb..a45c7a63 100644 --- a/misc/install.func +++ b/misc/install.func @@ -197,6 +197,16 @@ EOF msg_ok "Updated Container OS" } +# Install core packages that (almost) every container will depend upon. +# Be sure to update alpine-install.func to match for apk-based systems when +# adding a new package. +# a new package. +install_core_dependencies() { + msg_info "Installing core dependencies" + $STD apt-get install curl mc sudo + msg_ok "Installed core dependencies" +} + # This function modifies the message of the day (motd) and SSH settings motd_ssh() { # Set terminal to 256-color mode