net/script.sh

13 lines
497 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Настройка часового пояса Екатеринбурга
# sudo ./tz.sh
[[ $EUID -ne 0 ]] && { echo "Запустите с sudo"; exit 1; }
[[ "$(hostname)" =~ [Ss]witch ]] && { echo "Коммутатор - пропуск"; exit 0; }
timedatectl set-timezone Asia/Yekaterinburg
timedatectl set-ntp true
chronyc -a makestep &>/dev/null
echo "Часовой пояс установлен: $(timedatectl | grep "Time zone")"
echo "Текущее время: $(date)"