Advertisement
BlueRey

tzch.sh

Dec 17th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.36 KB | None | 0 0
  1. ### tzch.sh - v0.1
  2. ### A script for changing the timezone.
  3. ###
  4. ### Last update: 17/12/2019
  5.  
  6. #!/bin/bash
  7. ARGS=${@}
  8. TIMEZONE=$(timedatectl list-timezones | grep -m 1 ${ARGS// /_})
  9.  
  10. if [[ "$TIMEZONE" ]]; then
  11.         $(sudo timedatectl set-timezone $TIMEZONE)
  12.         echo "Time zone has change to: $TIMEZONE"
  13. else
  14.         echo "Time zone not found"
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement