mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-11 01:54:34 +08:00
Merge pull request #422 from SekoiaLab/fix/host-name-issue
Fix/host name issue
This commit is contained in:
commit
d3b1773da9
2 changed files with 5 additions and 2 deletions
|
@ -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{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue