mirror of
https://github.com/pstadler/metrics.sh.git
synced 2025-11-09 13:39:42 -05:00
structured main routines. implement file reporter
This commit is contained in:
7
lib/utils/helpers.sh
Normal file
7
lib/utils/helpers.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
is_number () {
|
||||
[ ! -z "$1" ] && printf '%f' "$1" &>/dev/null
|
||||
}
|
||||
|
||||
iso_date () {
|
||||
date -u +"%Y-%m-%dT%H:%M:%SZ"
|
||||
}
|
||||
@@ -14,11 +14,13 @@ is_linux () { [ $OS_TYPE == 'solaris' ]; }
|
||||
is_bsd () { [ $OS_TYPE == 'bsd']; }
|
||||
is_unknown () { [ $OS_TYPE == 'unknown' ]; }
|
||||
|
||||
|
||||
make_temp_dir () {
|
||||
if is_osx; then
|
||||
# http://unix.stackexchange.com/a/84980/50905
|
||||
if is_osx; then
|
||||
make_temp_dir () {
|
||||
mktemp -d -t 'sysmetrics'
|
||||
else
|
||||
}
|
||||
else
|
||||
make_temp_dir () {
|
||||
mktemp -d
|
||||
fi
|
||||
}
|
||||
}
|
||||
fi
|
||||
Reference in New Issue
Block a user