Merge pull request #422 from SekoiaLab/fix/host-name-issue

Fix/host name issue
This commit is contained in:
Alex 2021-11-04 08:52:30 -04:00 committed by GitHub
commit d3b1773da9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -10,6 +10,7 @@ import (
"os/signal"
"runtime/debug"
"strconv"
"strings"
"syscall"
"github.com/gravitl/netmaker/netclient/command"
@ -30,6 +31,7 @@ func main() {
if err != nil {
hostname = ""
}
hostname = strings.Split(hostname, ".")[0]
cliFlags := []cli.Flag{
&cli.StringFlag{

View file

@ -1,7 +1,7 @@
#!/bin/sh
if [ $(id -u) -ne 0 ]; then
echo "This script must be run as root"
echo "This script must be run as root"
exit 1
fi
@ -52,6 +52,7 @@ set -e
[ -z "$KEY" ] && KEY=nokey;
[ -z "$VERSION" ] && echo "no \$VERSION provided, fallback to latest" && VERSION=latest;
[ "latest" != "$VERSION" ] && [ "v" != `echo $VERSION | cut -c1` ] && VERSION="v$VERSION"
[ -z "$NAME" ] && NAME="";
dist=netclient
@ -105,5 +106,5 @@ else
wget -nv -O netclient https://github.com/gravitl/netmaker/releases/download/latest/$dist
fi
chmod +x netclient
sudo ./netclient join -t $KEY
sudo ./netclient join -t $KEY --name $NAME
rm -f netclient