diff --git a/cron-list.sh b/cron-list.sh index be59a8c..813e1c2 100644 --- a/cron-list.sh +++ b/cron-list.sh @@ -2,7 +2,7 @@ CRON_LIST=/data/$SRV_START_DIR/config/cron.cfg -trap 'echo -e "\033[31mcrom-list.sh: Something went wrong\033[0m"; exit 1' EXIT +trap 'echo -e "\033[31mcrom-list.sh: Something went wrong\033[0m"; exit 1' ERR set -e export DEBIAN_FRONTEND=noninteractive @@ -33,5 +33,5 @@ while IFS= read -r line; do fi done < "$CRON_LIST" -trap - EXIT -echo "Cron add ok." \ No newline at end of file +trap - ERR +echo "Cron jobs from $CRON_LIST added successfully" \ No newline at end of file diff --git a/env-gen.sh b/env-gen.sh index 51d22a3..33e83a5 100644 --- a/env-gen.sh +++ b/env-gen.sh @@ -1,41 +1,40 @@ #!/bin/bash -# Проверка наличия первого параметра if [ -z "$1" ]; then - echo "Использование: $0 <название_переменной> [значение]" + echo "Use: $0 [value]" exit 1 fi VARIABLE_NAME=$1 ENV_FILE="/data/secrets/$SERVER_DOMAIN/$SERVER_DOMAIN.env" -# Генерация случайного пароля из цифр и маленьких латинских букв длиной 20 символов +# Password gen: 20chars,0-9,a-z generate_random_password() { #tr -dc 'a-z0-9' > "$ENV_FILE" fi -echo "Переменная $VARIABLE_NAME успешно обновлена/добавлена в $ENV_FILE" \ No newline at end of file +echo "Variable $VARIABLE_NAME successfully updated/added to $ENV_FILE" \ No newline at end of file diff --git a/init-server.sh b/init-server.sh index bf9de65..1c0f45b 100644 --- a/init-server.sh +++ b/init-server.sh @@ -18,7 +18,7 @@ apt-get update apt-get upgrade -y echo "Install apps..." -apt-get install -y mc vim pwgen +apt-get install -y mc vim pwgen cron echo "Set timezone..." timedatectl set-timezone Asia/Yekaterinburg