Scripts/date_sys_mod.sh

38 lines
447 B
Bash

#!/bin/bash
# Cambio de hora del sistema
echo "ES NECESARIO SER ROOT"
x=0
y=2
while [ $x -le $y ];
do
clear
echo "1. Cambiar fecha"
echo "2. Restaurar fecha"
echo "3. Salir"
read x
case $x in
1)
clear
echo -n "Introduce fecha en formato \"mes-dia-hora-minutos-año.segundos\":"; read FECHA
date $FECHA
;;
2)
clear
echo "Restaurando fecha..."
ntpdate -u 0.arch.pool.ntp.org
;;
*)
clear
;;
esac
done