distribution/packages/jelos/sources/scripts/timeinfo

23 lines
529 B
Text
Raw Normal View History

2022-02-05 14:23:32 +00:00
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2020-2022 Shanti Gilbert (https://github.com/shantigilbert)
# Copyright (C) 2022-present Fewtarius (https://github.com/fewtarius)
function get_timezone() {
readlink -f /etc/localtime | sed 's;/usr/share/zoneinfo/;;'
}
function list_timezones() {
cat /usr/share/zoneinfo/zone1970.tab | grep -v "^#" | awk '{ print $3"," }' | sort -u
}
case "${1}" in
"current_timezone")
get_timezone
;;
"timezones")
list_timezones
;;
esac