Code refactoring

This commit is contained in:
tteckster 2023-05-15 07:39:30 -04:00 committed by GitHub
parent b09f213c84
commit c12f2773e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
97 changed files with 103 additions and 119 deletions

View File

@ -29,7 +29,7 @@ rm install.sh
msg_ok "Installed AdGuard Home"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -33,4 +33,4 @@ $STD /opt/AdGuardHome/AdGuardHome -s start
msg_ok "Installed Alpine-AdGuard"
motd_ssh
root
customize

View File

@ -59,4 +59,4 @@ if echo "$prompt" | grep -Eq "^(y|yes)$"; then
fi
motd_ssh
root
customize

View File

@ -29,4 +29,4 @@ $STD rc-update add grafana default
msg_ok "Installed Grafana"
motd_ssh
root
customize

View File

@ -37,4 +37,4 @@ $STD rc-update add vaultwarden default
msg_ok "Installed Alpine-Vaultwarden"
motd_ssh
root
customize

View File

@ -49,4 +49,4 @@ rc-update add -q whoogle default
msg_ok "Installed Alpine-Whoogle"
motd_ssh
root
customize

View File

@ -26,4 +26,4 @@ $STD apk add zigbee2mqtt
msg_ok "Installed Alpine-Zigbee2MQTT"
motd_ssh
root
customize

View File

@ -28,7 +28,7 @@ $STD apt install audiobookshelf
msg_ok "Installed audiobookshelf"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -49,7 +49,7 @@ systemctl enable --now -q autobrr.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -17,7 +17,6 @@ msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y unzip
$STD apt-get install -y python3-pip
msg_ok "Installed Dependencies"
@ -53,7 +52,7 @@ systemctl enable -q --now bazarr
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
rm -rf bazarr.zip

View File

@ -282,7 +282,7 @@ $STD systemctl enable --now blocky
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -17,7 +17,6 @@ msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y unzip
msg_ok "Installed Dependencies"
msg_info "Installing CasaOS (Patience)"
@ -37,7 +36,7 @@ $STD bash <(curl -fsSL https://get.casaos.io)
msg_ok "Installed CasaOS"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -43,7 +43,7 @@ $STD systemctl enable --now changedetection
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -28,7 +28,7 @@ $STD apt-get install -y cloudflared
msg_ok "Installed Cloudflared"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -48,7 +48,7 @@ $STD update-rc.d cronicled defaults
msg_ok "Installed Cronicle Primary Server"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -26,7 +26,7 @@ $STD dpkg -i daemonsync_2.2.0.0059_amd64.deb
msg_ok "Installed Daemon Sync Server"
motd_ssh
root
customize
msg_info "Cleaning up"
rm -rf daemonsync_2.2.0.0059_amd64.deb

View File

@ -57,7 +57,7 @@ systemctl start dashy
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -20,7 +20,7 @@ $STD apt-get install -y mc
msg_ok "Installed Dependencies"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -50,7 +50,7 @@ $STD systemctl enable --now deconz
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -65,7 +65,7 @@ systemctl enable --now -q deluge-web.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -20,7 +20,7 @@ $STD apt-get install -y mc
msg_ok "Installed Dependencies"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -69,7 +69,7 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
fi
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -19,7 +19,7 @@ $STD apt-get install -y sudo
$STD apt-get install -y mc
msg_ok "Installed Dependencies"
if [[ -z "$(grep -w "100000" /proc/self/uid_map)" ]]; then
if [[ "$CTTYPE" == "0" ]]; then
msg_info "Setting Up Hardware Acceleration"
$STD apt-get -y install \
va-driver-all \
@ -43,7 +43,7 @@ $STD dpkg -i emby-server-deb_${LATEST}_amd64.deb
msg_ok "Installed Emby"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -26,7 +26,7 @@ $STD systemctl enable --now emqx
msg_ok "Installed EMQX"
motd_ssh
root
customize
msg_info "Cleaning up"
apt-get autoremove >/dev/null

View File

@ -46,7 +46,7 @@ systemctl start esphomeDashboard
msg_ok "Installed ESPHome Dashboard"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -32,7 +32,7 @@ $STD apt-get install -y fhem
msg_info "Installed Fhem"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -43,7 +43,7 @@ systemctl enable -q --now go2rtc
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -35,7 +35,7 @@ systemctl enable --now -q grafana-server.service
msg_ok "Installed Grafana"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -18,7 +18,6 @@ $STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y apache2
$STD apt-get install -y unzip
$STD apt-get install -y apt-transport-https
$STD apt-get install -y lsb-release
msg_ok "Installed Dependencies"
@ -63,7 +62,7 @@ systemctl reload apache2
msg_ok "Installed grocy"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -58,7 +58,7 @@ $STD sudo systemctl enable --now heimdall.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -100,7 +100,7 @@ $STD systemctl enable --now homeassistant
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -84,7 +84,7 @@ $STD docker run -d \
msg_ok "Installed Home Assistant $CORE_LATEST_VERSION"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -32,7 +32,7 @@ $STD apt-get install -y homebridge
msg_info "Installed Homebridge"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -58,7 +58,7 @@ $STD systemctl enable --now homepage
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -17,7 +17,6 @@ msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y unzip
$STD apt-get install -y pip
msg_ok "Installed Dependencies"
@ -46,7 +45,7 @@ $STD systemctl enable --now homer
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -31,7 +31,7 @@ $STD systemctl enable --now hyperion@root.service
msg_ok "Installed Hyperion"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove >/dev/null

View File

@ -55,7 +55,7 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
fi
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -24,7 +24,7 @@ $STD bash <(curl -fsSL https://iobroker.net/install.sh)
msg_ok "Installed ioBroker"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -46,7 +46,7 @@ systemctl enable -q --now jackett.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -20,7 +20,7 @@ $STD apt-get install -y gnupg
$STD apt-get install -y mc
msg_ok "Installed Dependencies"
if [[ -z "$(grep -w "100000" /proc/self/uid_map)" ]]; then
if [[ "$CTTYPE" == "0" ]]; then
msg_info "Setting Up Hardware Acceleration"
$STD apt-get -y install \
va-driver-all \
@ -59,7 +59,7 @@ $STD apt-get install -y jellyfin
msg_ok "Installed Jellyfin"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -35,7 +35,7 @@ $STD bash <(curl -sSLf https://raw.githubusercontent.com/helm/helm/main/scripts/
msg_ok "Installed Helm"
fi
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -46,7 +46,7 @@ systemctl enable --now -q kavita.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -43,7 +43,7 @@ $STD systemctl enable --now keycloak.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -51,7 +51,7 @@ systemctl enable --now -q lidarr
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
rm -rf Lidarr.master.*.tar.gz

View File

@ -148,7 +148,7 @@ $STD systemctl enable --now magicmirror
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -35,7 +35,7 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
fi
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -35,7 +35,7 @@ $STD node node_modules/meshcentral --install
msg_ok "Installed MeshCentral"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -51,7 +51,7 @@ systemctl enable -q --now motioneye
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -31,7 +31,7 @@ $STD apt-get -y install mosquitto-clients
msg_ok "Installed Mosquitto MQTT Broker"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -46,7 +46,7 @@ $STD systemctl enable --now n8n
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -75,7 +75,7 @@ $STD systemctl enable --now navidrome.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -28,7 +28,7 @@ service apache2 restart
msg_ok "Installed NextCloudPi"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -182,7 +182,7 @@ EOF
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Starting Services"
sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf

View File

@ -53,7 +53,7 @@ systemctl enable --now nocodb.service &>/dev/null
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -56,7 +56,7 @@ $STD systemctl enable --now nodered.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -69,7 +69,7 @@ systemctl enable -q --now octoprint.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -30,7 +30,7 @@ $STD dpkg -i Omada_SDN_Controller_v5.9.31_Linux_x64.deb
msg_ok "Installed Omada Controller"
motd_ssh
root
customize
msg_info "Cleaning up"
rm -f Omada_SDN_Controller_v5.9.31_Linux_x64.deb mongodb-org-server_3.6.23_amd64.deb

View File

@ -42,7 +42,7 @@ omv-confdbadm populate
msg_ok "Installed OpenMediaVault"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -41,7 +41,7 @@ $STD systemctl enable --now openhab.service
msg_ok "Installed openHAB"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -27,7 +27,7 @@ $STD apt-get install -y --no-install-recommends \
redis \
postgresql \
build-essential \
imagemagick \
imagemagick \
fonts-liberation \
optipng \
gnupg \
@ -192,7 +192,7 @@ $STD systemctl enable --now paperless-consumer paperless-webserver paperless-sch
msg_ok "Created Services"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -23,7 +23,6 @@ $STD apt-get install -y git
$STD apt-get install -y gnupg
$STD apt-get install -y make
$STD apt-get install -y zip
$STD apt-get install -y unzip
$STD apt-get install -y exiftool
$STD apt-get install -y ffmpeg
msg_ok "Installed Dependencies"
@ -119,7 +118,7 @@ WantedBy=multi-user.target" >$service_path
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -46,7 +46,7 @@ $STD bash <(curl -fsSL https://install.pi-hole.net) /dev/stdin --unattended
msg_ok "Installed Pi-hole"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -19,7 +19,7 @@ $STD apt-get install -y sudo
$STD apt-get install -y mc
msg_ok "Installed Dependencies"
if [[ -z "$(grep -w "100000" /proc/self/uid_map)" ]]; then
if [[ "$CTTYPE" == "0" ]]; then
msg_info "Setting Up Hardware Acceleration"
$STD apt-get -y install \
va-driver-all \
@ -46,7 +46,7 @@ $STD apt-get -o Dpkg::Options::="--force-confold" install -y plexmediaserver
msg_ok "Installed Plex Media Server"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -46,7 +46,7 @@ $STD systemctl enable --now homeassistant
msg_ok "Installed Home Assistant"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -26,7 +26,7 @@ echo -e 'unqualified-search-registries=["docker.io"]' >> /etc/containers/registr
msg_ok "Installed Podman"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -142,7 +142,7 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
fi
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -55,7 +55,7 @@ $STD sudo systemctl enable --now prometheus
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -49,7 +49,7 @@ systemctl enable --now -q prowlarr
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
rm -rf Prowlarr.master.*.tar.gz

View File

@ -38,7 +38,7 @@ systemctl enable -q --now qbittorrent-nox
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -49,7 +49,7 @@ systemctl enable --now -q radarr
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
rm -rf Radarr.master.*.tar.gz

View File

@ -49,7 +49,7 @@ systemctl enable --now -q readarr
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
rm -rf Readarr.develop.*.tar.gz

View File

@ -53,7 +53,7 @@ systemctl enable -q --now rtsptoweb
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -17,7 +17,6 @@ msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y unzip
$STD apt-get install -y par2
$STD apt-get install -y p7zip-full
wget -q http://http.us.debian.org/debian/pool/non-free/u/unrar-nonfree/unrar_6.0.3-1+deb11u1_amd64.deb
@ -54,7 +53,7 @@ systemctl enable --now -q sabnzbd.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -110,7 +110,7 @@ $STD systemctl enable --now scrypted.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -82,7 +82,7 @@ $STD pm2 list
msg_ok "Installed Shinobi"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -29,7 +29,7 @@ DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" inst
msg_ok "Installed Sonarr"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -33,7 +33,7 @@ systemctl restart syncthing@root.service
msg_ok "Installed Syncthing"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -50,7 +50,7 @@ systemctl enable -q --now tautulli
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -17,7 +17,6 @@ msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y unzip
msg_ok "Installed Dependencies"
if [[ "$CTTYPE" == "0" ]]; then
@ -90,7 +89,7 @@ systemctl enable --now -q tdarr-node.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
rm -rf Tdarr_Updater.zip

View File

@ -35,7 +35,7 @@ $STD bash <(curl -fsSL https://download.technitium.com/dns/install.sh)
msg_ok "Installed Technitium DNS"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -28,7 +28,7 @@ systemctl start transmission-daemon
msg_ok "Installed Transmission"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -50,7 +50,7 @@ systemctl enable --now -q trilium
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -20,7 +20,7 @@ $STD apt-get install -y mc
msg_ok "Installed Dependencies"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -38,7 +38,7 @@ $STD systemctl enable --now umbrel-startup.service
msg_ok "Installed Umbrel"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -38,7 +38,7 @@ $STD apt-get install -y unifi
msg_ok "Installed UniFi Network Application"
motd_ssh
root
customize
msg_info "Cleaning up"
rm -rf mongodb-org-server_3.6.23_amd64.deb

View File

@ -53,7 +53,7 @@ $STD systemctl enable --now uptime-kuma.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -111,7 +111,7 @@ $STD systemctl enable --now vaultwarden.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -49,7 +49,7 @@ systemctl enable --now -q whisparr
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
rm -rf Whisparr.develop.*.tar.gz

View File

@ -42,7 +42,7 @@ $STD systemctl enable --now whoogle.service
msg_ok "Installed Whoogle"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -70,7 +70,7 @@ $STD systemctl enable --now wikijs
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -41,7 +41,7 @@ $STD bash <(curl -fsSL https://install.pivpn.io) --unattended options.conf
msg_ok "Installed WireGuard"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -30,7 +30,7 @@ $STD bash <(curl -fsSL https://install.yunohost.org) -a
msg_ok "Installed YunoHost"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -69,7 +69,7 @@ $STD systemctl enable zigbee2mqtt.service
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
$STD apt-get autoremove

View File

@ -17,7 +17,6 @@ msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y unzip
msg_ok "Installed Dependencies"
msg_info "Installing Z-Wave JS UI"
@ -45,7 +44,7 @@ $STD systemctl enable zwave-js-ui
msg_ok "Created Service"
motd_ssh
root
customize
msg_info "Cleaning up"
rm zwave-js-ui-${RELEASE}-linux.zip

View File

@ -117,13 +117,9 @@ motd_ssh() {
}
customize() {
if [[ "$PASSWORD" == "" ]]; then
msg_info "Customizing Container"
bash -c "passwd -d root" >/dev/null 2>&1
msg_ok "Customized Container"
}
root() {
if ! getent shadow root | grep -q '^root:[^:]*:\?\$'; then
customize
fi
}

View File

@ -169,7 +169,7 @@ advanced_settings() {
if PW1=$(whiptail --inputbox "\nSet Root Password (needed for root ssh access)" 9 58 --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3); then
if [ -z $PW1 ]; then
PW1="Automatic Login"
PW=" "
PW=""
else
PW="-password $PW1"
fi

View File

@ -116,6 +116,7 @@ motd_ssh() {
}
customize() {
if [[ "$PASSWORD" == "" ]]; then
msg_info "Customizing Container"
GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
mkdir -p $(dirname $GETTY_OVERRIDE)
@ -127,10 +128,5 @@ EOF
systemctl daemon-reload
systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//')
msg_ok "Customized Container"
}
root() {
if ! getent shadow root | grep -q "^root:[^\!*]"; then
customize
fi
}