Skip to content
Snippets Groups Projects
Commit 43652000 authored by MrMM's avatar MrMM
Browse files

Fixed generation of ssid when the nodename is short

parent 0f9ad6bb
No related branches found
No related tags found
No related merge requests found
......@@ -7,12 +7,12 @@ OFFLINE_PREFIX='FF_OFFLINE_' # Use something short to leave space for the nodena
# Generate an Offline SSID with the first and last Part of the nodename to allow owner to recognise wich node is down
NODENAME=`uname -n`
if [ ${#NODENAME} > 30-${#OFFLINE_PREFIX} ] ; then #32 would be possible as well
if [ ${#NODENAME} > $(30-${#OFFLINE_PREFIX}) ] ; then #32 would be possible as well
HALF=$(( (28 - ${#OFFLINE_PREFIX} ) / 2 ))
SKIP=$(( ${#NODENAME} - $HALF ))
OFFLINE_SSID=$OFFLINE_PREFIX${NODENAME:0:$HALF}...${NODENAME:$SKIP:${#NODENAME}} # use the first and last part of the nodename for nodes with long name
else
OFFLINE_SSID=`$OFFLINE_PREFIX$NODENAME`
OFFLINE_SSID="$OFFLINE_PREFIX$NODENAME"
fi
#Is there an active Gateway?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment