Skip to content

Commit c249de0

Browse files
committed
ADDED: get_next_collisioner function in functions_common.sh
1 parent f136946 commit c249de0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/core/functions_common.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,27 @@ generic_package_manager_override() {
483483
}
484484

485485

486+
# - Description: Get another unique string using the first argument as current element. The first argument is to be
487+
# expected as an integer, an empty string or nothing:
488+
# - if is an integer: return next integer
489+
# - if is empty string: return string "2"
490+
# - if nothing: return empty string
491+
# - Permission: Can be called as root or user.
492+
# - Argument 1: Current anticollisioner number
493+
get_next_collisioner()
494+
{
495+
if [ $# -eq 1 ]; then
496+
echo ""
497+
elif [ -z $1 ]; then
498+
echo "2"
499+
elif echo "$1" | grep -Eqo "[0-9]+"; then
500+
echo "$((1 + $1))"
501+
else
502+
output_proxy_executioner "Unexpected input in get_next_collisioner(): $1" "ERROR"
503+
fi
504+
}
505+
506+
486507
########################################################################################################################
487508
############################################### COMMON MAIN FUNCTIONS ##################################################
488509
########################################################################################################################

0 commit comments

Comments
 (0)