[Linux] Shell Script를 이용하여 Timezone 설정
·
Linux
더보기더보기처음 배우는 셸 스크립트 책 참고다수의 서버에 Timezone 설정필요한 명령어# Timezone을 확인하기 위한 명령어datetimectl staus# Timezone을 설정하기 위한 명령어dateimectl set-timezone스크립트#!/bin/bashservers="host01 host02 host03"cmd1="timedatectl status | grep 'Time zone'"cmd2="timedatectl set-timezone $1"if [[ -z $1 ]] || [[ -z $1 ]]then echo -e 'Please input timezone and password\nUsage: sh set-timezone.sh Seoul/Asia password'fifor s..