From 1789b71734d0e71cc7f40b542e1c410acb00d61c Mon Sep 17 00:00:00 2001 From: Duncan Hill Date: Tue, 7 Jan 2025 18:31:14 +0000 Subject: [PATCH 1/3] 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 From 67ddcd6ebbb7f2bfe68ed587501bb76775fb60c2 Mon Sep 17 00:00:00 2001 From: Duncan Hill Date: Tue, 7 Jan 2025 18:52:32 +0000 Subject: [PATCH 2/3] Update to title case to match other info/ok strings --- misc/alpine-install.func | 4 ++-- misc/install.func | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/alpine-install.func b/misc/alpine-install.func index f50c95c6..6c2e2d82 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -136,9 +136,9 @@ update_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" + msg_info "Installing Core Dependencies" $STD apk add curl mc nano newt openssh sudo - msg_ok "Installed core dependencies" + msg_ok "Installed Core Dependencies" } # This function modifies the message of the day (motd) and SSH settings diff --git a/misc/install.func b/misc/install.func index a45c7a63..54f63115 100644 --- a/misc/install.func +++ b/misc/install.func @@ -202,9 +202,9 @@ EOF # adding a new package. # a new package. install_core_dependencies() { - msg_info "Installing core dependencies" + msg_info "Installing Core Dependencies" $STD apt-get install curl mc sudo - msg_ok "Installed core dependencies" + msg_ok "Installed Core Dependencies" } # This function modifies the message of the day (motd) and SSH settings From d242578c3526a93d0b7b5d28a1a3bbb947ff4fe6 Mon Sep 17 00:00:00 2001 From: Duncan Hill Date: Tue, 7 Jan 2025 19:03:40 +0000 Subject: [PATCH 3/3] Fix duplication in comment, rename to install_core_packages --- install/alpine-docker-install.sh | 2 +- install/alpine-grafana-install.sh | 2 +- install/alpine-install.sh | 2 +- install/alpine-nextcloud-install.sh | 2 +- install/alpine-vaultwarden-install.sh | 2 +- install/alpine-zigbee2mqtt-install.sh | 2 +- install/debian-install.sh | 2 +- install/ubuntu-install.sh | 2 +- misc/alpine-install.func | 6 +++--- misc/install.func | 7 +++---- 10 files changed, 14 insertions(+), 15 deletions(-) diff --git a/install/alpine-docker-install.sh b/install/alpine-docker-install.sh index 6962873b..24e03f91 100644 --- a/install/alpine-docker-install.sh +++ b/install/alpine-docker-install.sh @@ -12,7 +12,7 @@ catch_errors setting_up_container network_check update_os -install_core_dependencies +install_core_packages msg_info "Installing Dependencies" $STD apk add tzdata diff --git a/install/alpine-grafana-install.sh b/install/alpine-grafana-install.sh index 1b2f409f..234661ac 100644 --- a/install/alpine-grafana-install.sh +++ b/install/alpine-grafana-install.sh @@ -12,7 +12,7 @@ catch_errors setting_up_container network_check update_os -install_core_dependencies +install_core_packages msg_info "Installing Grafana" $STD apk add grafana diff --git a/install/alpine-install.sh b/install/alpine-install.sh index 199e1516..a9e71e1c 100644 --- a/install/alpine-install.sh +++ b/install/alpine-install.sh @@ -12,7 +12,7 @@ catch_errors setting_up_container network_check update_os -install_core_dependencies +install_core_packages motd_ssh customize diff --git a/install/alpine-nextcloud-install.sh b/install/alpine-nextcloud-install.sh index da5224a9..53a66e4d 100644 --- a/install/alpine-nextcloud-install.sh +++ b/install/alpine-nextcloud-install.sh @@ -12,7 +12,7 @@ catch_errors setting_up_container network_check update_os -install_core_dependencies +install_core_packages msg_info "Installing Dependencies" $STD apk add openssl diff --git a/install/alpine-vaultwarden-install.sh b/install/alpine-vaultwarden-install.sh index 49dd79eb..de0a1fa2 100644 --- a/install/alpine-vaultwarden-install.sh +++ b/install/alpine-vaultwarden-install.sh @@ -12,7 +12,7 @@ catch_errors setting_up_container network_check update_os -install_core_dependencies +install_core_packages msg_info "Installing Dependencies" $STD apk add openssl diff --git a/install/alpine-zigbee2mqtt-install.sh b/install/alpine-zigbee2mqtt-install.sh index 2e3b3f8a..3c7eb7a0 100644 --- a/install/alpine-zigbee2mqtt-install.sh +++ b/install/alpine-zigbee2mqtt-install.sh @@ -12,7 +12,7 @@ catch_errors setting_up_container network_check update_os -install_core_dependencies +install_core_packages msg_info "Installing Alpine-Zigbee2MQTT" $STD apk add zigbee2mqtt diff --git a/install/debian-install.sh b/install/debian-install.sh index bed8876c..af8be8c8 100644 --- a/install/debian-install.sh +++ b/install/debian-install.sh @@ -12,7 +12,7 @@ catch_errors setting_up_container network_check update_os -install_core_dependencies +install_core_packages motd_ssh customize diff --git a/install/ubuntu-install.sh b/install/ubuntu-install.sh index 29ad16a4..45d2b372 100644 --- a/install/ubuntu-install.sh +++ b/install/ubuntu-install.sh @@ -12,7 +12,7 @@ catch_errors setting_up_container network_check update_os -install_core_dependencies +install_core_packages motd_ssh customize diff --git a/misc/alpine-install.func b/misc/alpine-install.func index 6c2e2d82..8b3276b0 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -135,10 +135,10 @@ update_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" +install_core_packages() { + msg_info "Installing Core Packages" $STD apk add curl mc nano newt openssh sudo - msg_ok "Installed Core Dependencies" + msg_ok "Installed Core Packages" } # This function modifies the message of the day (motd) and SSH settings diff --git a/misc/install.func b/misc/install.func index 54f63115..4331d229 100644 --- a/misc/install.func +++ b/misc/install.func @@ -200,11 +200,10 @@ EOF # 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" +install_core_packages() { + msg_info "Installing Core Packages" $STD apt-get install curl mc sudo - msg_ok "Installed Core Dependencies" + msg_ok "Installed Core Packages" } # This function modifies the message of the day (motd) and SSH settings