Your Name 1 year ago
parent
commit
00f5c3f16d
1 changed files with 53 additions and 2 deletions
  1. 53 2
      other_arch/alma.sh

+ 53 - 2
other_arch/alma.sh

@@ -1,4 +1,55 @@
 #!/bin/bash
+set -e
+Version=1.0
+
+#if (( $EUID != 0 )); then
+#   echo -e "$(tput setaf 11)This must be run as root. Try 'sudo $0'.$(tput sgr0)"
+#   exit 1
+#fi
+
+function print_centered {
+     [[ $# == 0 ]] && return 1
+
+     declare -i TERM_COLS="$(tput cols)"
+     declare -i str_len="${#1}"
+     [[ $str_len -ge $TERM_COLS ]] && {
+          echo "$1";
+          return 0;
+     }
+
+     declare -i filler_len="$(( (TERM_COLS - str_len) / 2 ))"
+     [[ $# -ge 2 ]] && ch="${2:0:1}" || ch=" "
+     filler=""
+     for (( i = 0; i < filler_len; i++ )); do
+          filler="${filler}${ch}"
+     done
+
+     printf "%s%s%s" "$filler" "$1" "$filler"
+     [[ $(( (TERM_COLS - str_len) % 2 )) -ne 0 ]] && printf "%s" "${ch}"
+     printf "\n"
+
+     return 0
+}
+
+function intro_ {
+clear
+print_centered "$(tput setaf 244)"
+print_centered "    _____  .__                 .____    .__                      "
+print_centered "   /  _  \ |  |   _____ _____  |    |   |__| ____  __ _____  ___ "
+print_centered "  /  /_\  \|  |  /     \\__  \ |    |   |  |/    \|  |  \  \/  / "
+print_centered " /    |    \  |_|  Y Y  \/ __ \|    |___|  |   |  \  |  />    <  "
+print_centered " \____|__  /____/__|_|  (____  /_______ \__|___|  /____//__/\_ \ "
+print_centered "         \/           \/     \/        \/       \/            \/ "
+echo -n "$(tput sgr0)$(tput setaf 10)"
+print_centered "Server installation script v$Version"
+print_centered "Dell R640"
+echo -n "$(tput sgr0)"
+print_centered "ne pas activer le login automatique..."
+print_centered "appuyer sur une touche pour continuer"
+read -p ""
+}
+
+
 function update_ {
 sudo dnf -y update
 sudo dnf install -y epel-release
@@ -106,10 +157,10 @@ sudo systemctl daemon-reload
 sudo systemctl enable wol.service
 sudo systemctl start wol.service
 }
-
+intro_
 update_
 wol_
 tigervnc_
 chia_
 miner_
-#webmin_
+webmin_