Rebuilt targets
This commit is contained in:
parent
2b163d385b
commit
f8df6b8eab
|
@ -41,7 +41,7 @@ IS_STABLE=yes
|
||||||
|
|
||||||
|
|
||||||
_OFUNCTIONS_VERSION=2.1.4-dev
|
_OFUNCTIONS_VERSION=2.1.4-dev
|
||||||
_OFUNCTIONS_BUILD=2017052901
|
_OFUNCTIONS_BUILD=2017052902
|
||||||
_OFUNCTIONS_BOOTSTRAP=true
|
_OFUNCTIONS_BOOTSTRAP=true
|
||||||
|
|
||||||
## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||||
|
@ -105,6 +105,8 @@ if [ "$SLEEP_TIME" == "" ]; then # Leave the possibity to set SLEEP_TIME as envi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SCRIPT_PID=$$
|
SCRIPT_PID=$$
|
||||||
|
|
||||||
|
# TODO: Check if %N works on MacOS
|
||||||
TSTAMP=$(date '+%Y%m%dT%H%M%S.%N')
|
TSTAMP=$(date '+%Y%m%dT%H%M%S.%N')
|
||||||
|
|
||||||
LOCAL_USER=$(whoami)
|
LOCAL_USER=$(whoami)
|
||||||
|
@ -347,13 +349,14 @@ function KillChilds {
|
||||||
local pid="${1}" # Parent pid to kill childs
|
local pid="${1}" # Parent pid to kill childs
|
||||||
local self="${2:-false}" # Should parent be killed too ?
|
local self="${2:-false}" # Should parent be killed too ?
|
||||||
|
|
||||||
if [ $(IsNumeric "$pid") -eq 0 ] || [ "$pid" == "" ] || [ "$pid" == "0" ]; then
|
# Paranoid checks, we can safely assume that $pid shouldn't be 0 nor 1
|
||||||
|
if [ $(IsNumeric "$pid") -eq 0 ] || [ "$pid" == "" ] || [ "$pid" == "0" ] || [ "$pid" == "1" ]; then
|
||||||
Logger "Bogus pid given [$pid]." "CRITICAL"
|
Logger "Bogus pid given [$pid]." "CRITICAL"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if kill -0 "$pid" > /dev/null 2>&1; then
|
if kill -0 "$pid" > /dev/null 2>&1; then
|
||||||
# Warning: pgrep does not exist in cygwin, have this checked in CheckEnvironment
|
# Warning: pgrep is not native on cygwin, have this checked in CheckEnvironment
|
||||||
if children="$(pgrep -P "$pid")"; then
|
if children="$(pgrep -P "$pid")"; then
|
||||||
if [[ "$pid" == *"$children"* ]]; then
|
if [[ "$pid" == *"$children"* ]]; then
|
||||||
Logger "Bogus pgrep implementation." "CRITICAL"
|
Logger "Bogus pgrep implementation." "CRITICAL"
|
||||||
|
@ -2056,7 +2059,7 @@ function TrapQuit {
|
||||||
exitcode=0
|
exitcode=0
|
||||||
fi
|
fi
|
||||||
CleanUp
|
CleanUp
|
||||||
KillChilds $$ > /dev/null 2>&1
|
KillChilds $SCRIPT_PID > /dev/null 2>&1
|
||||||
|
|
||||||
exit $exitcode
|
exit $exitcode
|
||||||
}
|
}
|
||||||
|
|
11
osync.sh
11
osync.sh
|
@ -10,7 +10,7 @@ IS_STABLE=yes
|
||||||
|
|
||||||
|
|
||||||
_OFUNCTIONS_VERSION=2.1.4-dev
|
_OFUNCTIONS_VERSION=2.1.4-dev
|
||||||
_OFUNCTIONS_BUILD=2017052901
|
_OFUNCTIONS_BUILD=2017052902
|
||||||
_OFUNCTIONS_BOOTSTRAP=true
|
_OFUNCTIONS_BOOTSTRAP=true
|
||||||
|
|
||||||
## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||||
|
@ -70,6 +70,8 @@ if [ "$SLEEP_TIME" == "" ]; then # Leave the possibity to set SLEEP_TIME as envi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SCRIPT_PID=$$
|
SCRIPT_PID=$$
|
||||||
|
|
||||||
|
# TODO: Check if %N works on MacOS
|
||||||
TSTAMP=$(date '+%Y%m%dT%H%M%S.%N')
|
TSTAMP=$(date '+%Y%m%dT%H%M%S.%N')
|
||||||
|
|
||||||
LOCAL_USER=$(whoami)
|
LOCAL_USER=$(whoami)
|
||||||
|
@ -301,13 +303,14 @@ function KillChilds {
|
||||||
local pid="${1}" # Parent pid to kill childs
|
local pid="${1}" # Parent pid to kill childs
|
||||||
local self="${2:-false}" # Should parent be killed too ?
|
local self="${2:-false}" # Should parent be killed too ?
|
||||||
|
|
||||||
if [ $(IsNumeric "$pid") -eq 0 ] || [ "$pid" == "" ] || [ "$pid" == "0" ]; then
|
# Paranoid checks, we can safely assume that $pid shouldn't be 0 nor 1
|
||||||
|
if [ $(IsNumeric "$pid") -eq 0 ] || [ "$pid" == "" ] || [ "$pid" == "0" ] || [ "$pid" == "1" ]; then
|
||||||
Logger "Bogus pid given [$pid]." "CRITICAL"
|
Logger "Bogus pid given [$pid]." "CRITICAL"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if kill -0 "$pid" > /dev/null 2>&1; then
|
if kill -0 "$pid" > /dev/null 2>&1; then
|
||||||
# Warning: pgrep does not exist in cygwin, have this checked in CheckEnvironment
|
# Warning: pgrep is not native on cygwin, have this checked in CheckEnvironment
|
||||||
if children="$(pgrep -P "$pid")"; then
|
if children="$(pgrep -P "$pid")"; then
|
||||||
if [[ "$pid" == *"$children"* ]]; then
|
if [[ "$pid" == *"$children"* ]]; then
|
||||||
Logger "Bogus pgrep implementation." "CRITICAL"
|
Logger "Bogus pgrep implementation." "CRITICAL"
|
||||||
|
@ -1896,7 +1899,7 @@ function TrapQuit {
|
||||||
exitcode=0
|
exitcode=0
|
||||||
fi
|
fi
|
||||||
CleanUp
|
CleanUp
|
||||||
KillChilds $$ > /dev/null 2>&1
|
KillChilds $SCRIPT_PID > /dev/null 2>&1
|
||||||
|
|
||||||
exit $exitcode
|
exit $exitcode
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue