Commit f912bc78 authored by Natanael Copa's avatar Natanael Copa
Browse files

setup-timezone: remove -p <POSIXTZ> option

parent b90ed415
...@@ -8,13 +8,12 @@ zroot=/usr/share/zoneinfo ...@@ -8,13 +8,12 @@ zroot=/usr/share/zoneinfo
usage() { usage() {
cat <<__EOF__ cat <<__EOF__
usage: setup-timezone [-h] [-p posixtz format] [-z subfolder of $zroot] usage: setup-timezone [-h] [-z subdir of $zroot]
Sets the timezone for the system. Sets the timezone for the system.
options: options:
-h Show this help -h Show this help
-p Specify the timezone in PosixTZ format
-z Specify the timezone as a subfolder of $zroot -z Specify the timezone as a subfolder of $zroot
__EOF__ __EOF__
exit 1 exit 1
...@@ -43,10 +42,9 @@ valid_tz() { ...@@ -43,10 +42,9 @@ valid_tz() {
| xargs posixtz | sort | uniq | grep -q -w "$1" | xargs posixtz | sort | uniq | grep -q -w "$1"
} }
while getopts "hp:z:" opt; do while getopts "hz:" opt; do
case $opt in case $opt in
h) usage;; h) usage;;
p) POSIXTZ="$OPTARG";;
z) ZONEINFOFOLDER="$OPTARG";; z) ZONEINFOFOLDER="$OPTARG";;
esac esac
done done
...@@ -59,11 +57,6 @@ zonepath=$(cat /etc/TZ 2>/dev/null) ...@@ -59,11 +57,6 @@ zonepath=$(cat /etc/TZ 2>/dev/null)
[ -z "$zonepath" ] && zonepath="UTC" [ -z "$zonepath" ] && zonepath="UTC"
while true; do while true; do
if [ -n "$POSIXTZ" ]; then
echo $POSIXTZ > /etc/TZ || rm -f /etc/TZ
break
fi
if [ -n "$ZONEINFOFOLDER" ]; then if [ -n "$ZONEINFOFOLDER" ]; then
TZ=$(posixtz "$ZONEINFOFOLDER") || echo "Failed to convert '$ZONEINFOFOLDER' to POSIX TZ" TZ=$(posixtz "$ZONEINFOFOLDER") || echo "Failed to convert '$ZONEINFOFOLDER' to POSIX TZ"
if [ -n "$TZ" ]; then if [ -n "$TZ" ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment