diff --git a/install/usr/share/swarmlab.io/sec/swarmlab-sec b/install/usr/share/swarmlab.io/sec/swarmlab-sec index 5e6de88..b68d733 100755 --- a/install/usr/share/swarmlab.io/sec/swarmlab-sec +++ b/install/usr/share/swarmlab.io/sec/swarmlab-sec @@ -81,23 +81,12 @@ service_URL=http DOCKERuser="docker" Wdir=${cwdir}/$IMAGE_local +if [ ! -d $Wdir ]; then + mkdir -p $Wdir +fi # edit it - EDIT_END -# you do not need to edit it - BEGIN -cat << FOE > swarmlab-index.js -export const myApiConfig = [ - { - "swarmlabname": "$IMAGE_local", - "git": "$GIT_origin", - "gui": $service_GUI, - "web": $service_WEB, - "url": "$service_URL", - "version": 0, - "port": 0 - } -]; -FOE APTPARAM=" --no-install-recommends " HYBRID_NETWORK=$IMAGE_local bootstrap="sec_bootstrap" @@ -106,26 +95,12 @@ hostnames_get="get_hosts" NODENAME=${IMAGE_local}_masterservice_1.${IMAGE_local}_${HYBRID_NETWORK} NODENETWORK=${HYBRID_NETWORK} -# shellcheck disable=SC1091 -#. ./.env - - - # ----------------------------------------------- # # Load Default config swarmlab.io # # ---------------------------------------------- - - - -# ----------------------------------------------- -# -# Find Working dir -# -# ---------------------------------------------- - function EPHEMERAL_PORT() { LOW_BOUND=49152 RANGE=16384 @@ -141,7 +116,6 @@ function EPHEMERAL_PORT() { servicesshport=$(EPHEMERAL_PORT) -Wdir=$(pwd) if [ ! -f $Wdir/.env ]; then cat << EOF > $Wdir/.env @@ -149,9 +123,11 @@ REGISTRY_ADDR=localhost REGISTRY_PORT=5000 IMAGE_NAME=$HYBRID_NETWORK SSH_PORT=$servicesshport -WEB_PORT=$(EPHEMERAL_PORT) -WEB_PORT1=$(EPHEMERAL_PORT) -WEB_PORT2=$(EPHEMERAL_PORT) +R_PORT1=$(EPHEMERAL_PORT) +R_PORT2=$(EPHEMERAL_PORT) +R_PORT3=$(EPHEMERAL_PORT) +R_PORT4=$(EPHEMERAL_PORT) +R_PORT5=$(EPHEMERAL_PORT) EOF fi @@ -352,6 +328,20 @@ fi /bin/cp -rf $SRPATH/install-vim-plugin.sh $Wdir/install-vim-plugin.sh # you do not need to edit it - END +# you do not need to edit it - BEGIN +cat << FOE > $Wdir/swarmlab-index.js +export const myApiConfig = [ + { + "swarmlabname": "$IMAGE_local", + "git": "$GIT_origin", + "gui": $service_GUI, + "web": $service_WEB, + "url": "$service_URL", + "version": 0, + "port": 0 + } +]; +FOE # ############################### # EDIT-BEGIN