projects
/
BK-2020-03.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
style(unitproc):appendFileTar():VAR_NAME to varName
[BK-2020-03.git]
/
unitproc
/
bktemp-setTimeZoneEV
diff --git
a/unitproc/bktemp-setTimeZoneEV
b/unitproc/bktemp-setTimeZoneEV
index 548e1bf8157248d7ac3d8dc472ff426610789a58..8b5370b6125965ff59c113339818c1dc45b179b7 100644
(file)
--- a/
unitproc/bktemp-setTimeZoneEV
+++ b/
unitproc/bktemp-setTimeZoneEV
@@
-8,6
+8,7
@@
try() { "$@" || die "cannot $*"; }
setTimeZoneEV(){
# Desc: Set time zone environment variable TZ
# Usage: setTimeZoneEV arg1
setTimeZoneEV(){
# Desc: Set time zone environment variable TZ
# Usage: setTimeZoneEV arg1
+ # Version 0.1.1
# Input: arg1: 'date'-compatible timezone string (ex: "America/New_York")
# TZDIR env var (optional; default: "/usr/share/zoneinfo")
# Output: exports TZ
# Input: arg1: 'date'-compatible timezone string (ex: "America/New_York")
# TZDIR env var (optional; default: "/usr/share/zoneinfo")
# Output: exports TZ
@@
-16,8
+17,9
@@
setTimeZoneEV(){
# exit code 2 if unable to validate arg1
# Depends: yell, printenv, bash 5
# Tested on: Debian 10
# exit code 2 if unable to validate arg1
# Depends: yell, printenv, bash 5
# Tested on: Debian 10
- ARG1="$1"
- local tzDir returnState
+ local tzDir returnState argTimeZone
+
+ argTimeZone="$1"
if ! [[ $# -eq 1 ]]; then
yell "ERROR:Invalid argument count.";
return 1;
if ! [[ $# -eq 1 ]]; then
yell "ERROR:Invalid argument count.";
return 1;
@@
-31,12
+33,12
@@
setTimeZoneEV(){
fi
# Validate TZ string
fi
# Validate TZ string
- if ! [[ -f "$tzDir"/"$
ARG1
" ]]; then
+ if ! [[ -f "$tzDir"/"$
argTimeZone
" ]]; then
yell "ERROR:Invalid time zone argument.";
return 2;
else
# Export ARG1 as TZ environment variable
yell "ERROR:Invalid time zone argument.";
return 2;
else
# Export ARG1 as TZ environment variable
- TZ="$
ARG1
" && export TZ && returnState="true";
+ TZ="$
argTimeZone
" && export TZ && returnState="true";
fi
# Determine function return code
fi
# Determine function return code