Skip to content

Instantly share code, notes, and snippets.

@dmi3mis
Last active August 18, 2020 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmi3mis/f4606852618d0d5336023670767124b8 to your computer and use it in GitHub Desktop.
Save dmi3mis/f4606852618d0d5336023670767124b8 to your computer and use it in GitHub Desktop.
for host in master node1 node2 services workstation; do
echo "Changing date on ${host} ..."
case ${host} in
services)
sshpass -p redhat ssh -o StrictHostKeyChecking=no root@${host} 'systemctl stop mariadb'
;;
esac
sshpass -p redhat ssh -o StrictHostKeyChecking=no root@${host} 'systemctl disable --now chronyd && timedatectl set-time "2020-07-05 `date +%T`" && reboot'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment