distribution/packages/jelos/sources/scripts/timeinfo

23 lines
578 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) 2023-present - The JELOS Project (https://github.com/JustEnoughLinuxOS) (https://github.com/fewtarius)
2022-02-05 14:23:32 +00:00
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