War for conflicting scripts only if script is running in a terminal.
This commit is contained in:
parent
25dc227b68
commit
ffc7fe5f5b
@ -74,6 +74,14 @@ warn (){
|
|||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
warn_only_terminal () {
|
||||||
|
if $terminal ; then
|
||||||
|
echo ""
|
||||||
|
echo -e "\t[ \033[33m\033[1mWarning\033[m ]: $*"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
info (){
|
info (){
|
||||||
echo ""
|
echo ""
|
||||||
if $terminal ; then
|
if $terminal ; then
|
||||||
@ -141,6 +149,19 @@ is_number() {
|
|||||||
#return $([[ ! -z "${1##*[!0-9]*}" ]])
|
#return $([[ ! -z "${1##*[!0-9]*}" ]])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trim() {
|
||||||
|
local var="$*"
|
||||||
|
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
|
||||||
|
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
|
||||||
|
echo -n "$var"
|
||||||
|
}
|
||||||
|
|
||||||
|
blank_line() {
|
||||||
|
if $terminal ; then
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
reboot_system() {
|
reboot_system() {
|
||||||
|
|
||||||
# content_type='Content-Type: text/plain;\n charset="utf-8"'
|
# content_type='Content-Type: text/plain;\n charset="utf-8"'
|
||||||
@ -257,11 +278,9 @@ if [[ ${#CONFLICTING_SCRIPTS} -gt 0 ]] ; then
|
|||||||
|
|
||||||
if $_stop_running ; then
|
if $_stop_running ; then
|
||||||
|
|
||||||
echo ""
|
warn_only_terminal "\033[1m${_script_name}\033[m is currently running, but it conflicts with this script.
|
||||||
echo "[ Error ]: The \"${_script_name}\" script is currently running, but it conflicts with this script."
|
|
||||||
echo ""
|
Exiting now.."
|
||||||
echo " Exiting now.."
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
clean_up 1
|
clean_up 1
|
||||||
|
|
||||||
|
@ -74,6 +74,14 @@ warn (){
|
|||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
warn_only_terminal () {
|
||||||
|
if $terminal ; then
|
||||||
|
echo ""
|
||||||
|
echo -e " [ \033[33m\033[1mWarning\033[m ]: $*"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
info (){
|
info (){
|
||||||
echo ""
|
echo ""
|
||||||
if $terminal ; then
|
if $terminal ; then
|
||||||
@ -141,6 +149,19 @@ is_number() {
|
|||||||
#return $([[ ! -z "${1##*[!0-9]*}" ]])
|
#return $([[ ! -z "${1##*[!0-9]*}" ]])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trim() {
|
||||||
|
local var="$*"
|
||||||
|
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
|
||||||
|
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
|
||||||
|
echo -n "$var"
|
||||||
|
}
|
||||||
|
|
||||||
|
blank_line() {
|
||||||
|
if $terminal ; then
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
reboot_system() {
|
reboot_system() {
|
||||||
|
|
||||||
# content_type='Content-Type: text/plain;\n charset="utf-8"'
|
# content_type='Content-Type: text/plain;\n charset="utf-8"'
|
||||||
@ -257,11 +278,9 @@ if [[ ${#CONFLICTING_SCRIPTS} -gt 0 ]] ; then
|
|||||||
|
|
||||||
if $_stop_running ; then
|
if $_stop_running ; then
|
||||||
|
|
||||||
echo ""
|
warn_only_terminal "\033[1m${_script_name}\033[m is currently running, but it conflicts with this script.
|
||||||
echo "[ Error ]: The \"${_script_name}\" script is currently running, but it conflicts with this script."
|
|
||||||
echo ""
|
Exiting now.."
|
||||||
echo " Exiting now.."
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
clean_up 1
|
clean_up 1
|
||||||
|
|
||||||
|
@ -74,6 +74,14 @@ warn (){
|
|||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
warn_only_terminal () {
|
||||||
|
if $terminal ; then
|
||||||
|
echo ""
|
||||||
|
echo -e "\t[ \033[33m\033[1mWarning\033[m ]: $*"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
echo_done() {
|
echo_done() {
|
||||||
if $terminal && $LOGGING ; then
|
if $terminal && $LOGGING ; then
|
||||||
echo -e "\033[75G[ \033[32mdone\033[m ]"
|
echo -e "\033[75G[ \033[32mdone\033[m ]"
|
||||||
@ -121,6 +129,19 @@ is_number() {
|
|||||||
#return $([[ ! -z "${1##*[!0-9]*}" ]])
|
#return $([[ ! -z "${1##*[!0-9]*}" ]])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trim() {
|
||||||
|
local var="$*"
|
||||||
|
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
|
||||||
|
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
|
||||||
|
echo -n "$var"
|
||||||
|
}
|
||||||
|
|
||||||
|
blank_line() {
|
||||||
|
if $terminal ; then
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
reboot_system() {
|
reboot_system() {
|
||||||
|
|
||||||
# content_type='Content-Type: text/plain;\n charset="utf-8"'
|
# content_type='Content-Type: text/plain;\n charset="utf-8"'
|
||||||
@ -240,11 +261,9 @@ if [[ ${#CONFLICTING_SCRIPTS} -gt 0 ]] ; then
|
|||||||
|
|
||||||
if $_stop_running ; then
|
if $_stop_running ; then
|
||||||
|
|
||||||
echo ""
|
warn_only_terminal "\033[1m${_script_name}\033[m is currently running, but it conflicts with this script.
|
||||||
echo "[ Error ]: The \"${_script_name}\" script is currently running, but it conflicts with this script."
|
|
||||||
echo ""
|
Exiting now.."
|
||||||
echo " Exiting now.."
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
clean_up 1
|
clean_up 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user