diff options
author | Christian Rößler | 2015-11-17 17:05:56 +0100 |
---|---|---|
committer | Christian Rößler | 2015-11-17 17:05:56 +0100 |
commit | 7e76df9468a475ea47f7a494b1ec817178cd1fa0 (patch) | |
tree | bbaba7070e02efb4084d8f72ab48ffb72ee80103 | |
parent | [SSPS] Base atftpd systemd service file (ExecStart etc. should be edited furt... (diff) | |
download | setup-scripts-7e76df9468a475ea47f7a494b1ec817178cd1fa0.tar.gz setup-scripts-7e76df9468a475ea47f7a494b1ec817178cd1fa0.tar.xz setup-scripts-7e76df9468a475ea47f7a494b1ec817178cd1fa0.zip |
[SSPS] Password change enforced and repeated (firstrun), some cosmetics etc.
-rw-r--r-- | satellit_installer/includes/00-perror.inc | 6 | ||||
-rw-r--r-- | satellit_installer/includes/10-configurations.inc | 22 | ||||
-rwxr-xr-x | satellit_installer/satellit_installer | 3 | ||||
-rw-r--r-- | satellit_installer/static_files/firstrun_script.sh | 6 |
4 files changed, 26 insertions, 11 deletions
diff --git a/satellit_installer/includes/00-perror.inc b/satellit_installer/includes/00-perror.inc index eed3d1c..8fa82a8 100644 --- a/satellit_installer/includes/00-perror.inc +++ b/satellit_installer/includes/00-perror.inc @@ -1,9 +1,13 @@ declare -rg MYPID=$$ -perror () { +perror() { echo "[ERROR] *" "$@" [ "$$" != "$MYPID" ] && kill "$MYPID" exit 1 } +pwarning() { + echo "[WARNING] *" "$@" +} + diff --git a/satellit_installer/includes/10-configurations.inc b/satellit_installer/includes/10-configurations.inc index f722947..64df575 100644 --- a/satellit_installer/includes/10-configurations.inc +++ b/satellit_installer/includes/10-configurations.inc @@ -1,14 +1,14 @@ patch_atftpd_config() { - echo -n "# Stopping atftpd server in case it's not managed by inetd..." + echo -n "# Stopping atftpd server in case it's not managed by inetd... " [ "$SYSTEMD" ] && systemctl stop atftpd || /etc/init.d/atftpd stop 2>/dev/null 1>&2 echo "ok." # No sense in patching, we will drop this little entry. - echo -n "# Patching atftpd configuration..." + echo -n "# Patching atftpd configuration... " echo "USE_INETD=false" > /etc/default/atftpd echo 'OPTIONS="--retry-timeout 1 --maxthread 100 --verbose=5 --no-multicast --bind-address 0.0.0.0 /srv/openslx/tftp"' >> /etc/default/atftpd echo "ok." # sometimes a tftp stating line remains in /etc/inetd.conf. Let's have a look and kill this interesting line: - echo -n "# Checking /etc/inetd.conf for a tftp entry..." + echo -n "# Checking /etc/inetd.conf for a tftp entry... " if [ $(grep -c "^tftp.*dgram.*udp4" /etc/inetd.conf) -gt 0 ]; then echo -n " found. Deleting... " sed -i '/^tftp.*dgram.*udp4/d' /etc/inetd.conf @@ -18,19 +18,24 @@ patch_atftpd_config() { fi } +copy_atftpd_service() { + echo -n "# Copying atftpd service file... " + cp -p "$BASEDIR/static_files/atftpd.service" /etc/systemd/system && echo "ok." || perror "failed." +} + patch_lighttpd_config() { service lighttpd stop echo -n "# Patching lighttpd configuration..." - cp -p "$BASEDIR/static_files/lighttpd.conf" /etc/lighttpd/lighttpd.conf || perror "failed" - cp -p "$BASEDIR/static_files/lighttpd-auto-ssl.sh" /usr/share/lighttpd/auto-ssl.sh || perror "failed" + cp -p "$BASEDIR/static_files/lighttpd.conf" /etc/lighttpd/lighttpd.conf || perror "failed." + cp -p "$BASEDIR/static_files/lighttpd-auto-ssl.sh" /usr/share/lighttpd/auto-ssl.sh || perror "failed." chmod +x /usr/share/lighttpd/auto-ssl.sh || perror "failed" echo "ok." - cd /etc/lighttpd/conf-enabled || perror "Could not cd to conf-enabled" + cd /etc/lighttpd/conf-enabled || perror "Could not cd to conf-enabled." [ ! -h 10-fastcgi.conf ] && ln -s ../conf-available/10-fastcgi.conf [ ! -h 15-fastcgi-php.conf ] && ln -s ../conf-available/15-fastcgi-php.conf # Increase php threads sed -i 's/"PHP_FCGI_CHILDREN.*$/"PHP_FCGI_CHILDREN" => "32",/' "15-fastcgi-php.conf" - mkdir -p "$1" || perror "Could not create $1" + mkdir -p "$1" || perror "Could not create $1." } config_nfs() { @@ -47,6 +52,7 @@ config_nfs() { } write_apt_config() { - cp "$BASEDIR/static_files/system/apt-upgrade-conf" "/etc/apt/apt.conf.d/02periodic" + echo -n "# Configuring apt unattended/periodic updates... " + cp "$BASEDIR/static_files/system/apt-upgrade-conf" "/etc/apt/apt.conf.d/02periodic" && echo " done." || pwarning "failed." } diff --git a/satellit_installer/satellit_installer b/satellit_installer/satellit_installer index 750ed67..b84f7ea 100755 --- a/satellit_installer/satellit_installer +++ b/satellit_installer/satellit_installer @@ -121,6 +121,7 @@ add_mysql_dbs_users # mysql stuff; adding databases and users patch_mysql_config # adding utf8 entries to /etc/mysql/my.cnf patch_atftpd_config +copy_atftpd_service patch_lighttpd_config "$WWWDIR" # $1: lighttpd http root @@ -188,6 +189,6 @@ end_message finalize # Cleaning script; finalize script will delete itself. [ "$NODELETE_SOURCE" != "true" ] && { echo "#"; echo "# Deleting source directory..."; rm -rf "$BASEDIR"; echo "# done."; } \ - || { echo "#"; echo "# Not deleting source directory; nodelete optin given."; } + || { echo "#"; echo "# Not deleting source directory; nodelete option was given."; } exit 0 diff --git a/satellit_installer/static_files/firstrun_script.sh b/satellit_installer/static_files/firstrun_script.sh index 4ff21a6..4db18b9 100644 --- a/satellit_installer/static_files/firstrun_script.sh +++ b/satellit_installer/static_files/firstrun_script.sh @@ -11,7 +11,11 @@ im Produktivbetrieb zu ändern! HEREDOC -passwd +ERR=1 +while [ "$ERR" -ne 0 ]; do + passwd + ERR=$? +done echo "Abschließend können Sie festlegen, ob der Server seine IP-Konfiguration" echo "per DHCP erhält, oder eine statische Konfiguration verwendet wird." |