diff --git a/installer/ogboot_installer.sh b/installer/ogboot_installer.sh index 56529f1..f2ff08f 100644 --- a/installer/ogboot_installer.sh +++ b/installer/ogboot_installer.sh @@ -721,6 +721,16 @@ function backupFile() echoAndLog "${FUNCNAME}(): $file backup success" } +mask2cidr() { + IFS='.' read -ra ADDR <<< "$1" + CIDR=0 + for i in "${ADDR[@]}"; do + CIDR=$((CIDR+$(echo "obase=2; ibase=10; $i" | bc | tr -cd '1' | wc -c))) + done + echo $CIDR +} + + ########################################################################## ################################main###################################### @@ -791,6 +801,7 @@ if [ $? -ne 0 ]; then exit 1 fi + #downloadComposer # #runComposer