調子に乗ってさらにタイムサーバまで作りました。設定ファイルを丸コピーは楽勝。文字探して、そこに上書きとか面倒なことを考えなければ速攻出来上がる。
#!/usr/bin/bash #====================================================================== # aptのアップデート #====================================================================== yes | sudo apt-get update yes | sudo apt-get upgrade
#====================================================================== # Softのインストール #====================================================================== sudo apt -y install ntp
#====================================================================== # 既存ファイルのバックアップ #====================================================================== sudo mv /etc/ntp.conf{,_back}
#====================================================================== # 設定ファイルのコピー #====================================================================== sudo cp ./ntp.conf /etc/
#====================================================================== # ファイルのパーミッション変更 #====================================================================== sudo chown root:root /etc/ntp.conf
#====================================================================== # 再起動 #====================================================================== sudo systemctl restart ntp
|
コメントする