Skip to content

Commit

Permalink
Fix MacOS custom netbird up command (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
moadqassem authored Dec 11, 2022
1 parent c677eea commit 2fa33ec
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
5 changes: 2 additions & 3 deletions src/components/addpeer/MacTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, {useState} from 'react';
import { Button } from "antd";
import TabSteps from "./TabSteps";
import { StepCommand } from "./types"
import { formatNetBirdUP } from "./common"

export const LinuxTab = () => {

Expand Down Expand Up @@ -30,9 +31,7 @@ export const LinuxTab = () => {
{
key: 3,
title: 'Run NetBird and log in the browser:',
commands: [
`sudo netbird up`
].join('\n'),
commands: formatNetBirdUP(),
copied: false,
showCopyButton: true
} as StepCommand,
Expand Down
13 changes: 2 additions & 11 deletions src/components/addpeer/UbuntuTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,11 @@ import TabSteps from "./TabSteps";
import { StepCommand } from "./types"
import { getConfig } from "../../config";
import Paragraph from 'antd/lib/skeleton/Paragraph';
const { grpcApiOrigin } = getConfig();
import { formatNetBirdUP } from "./common"


export const UbuntuTab = () => {

const formatNetBirdUP = () => {
let cmd = "sudo netbird up"
if (grpcApiOrigin) {
cmd = "sudo netbird up --management-url " + grpcApiOrigin
}
return [
cmd
].join('\n')
}
export const UbuntuTab = () => {

const [steps, setSteps] = useState([
{
Expand Down
13 changes: 13 additions & 0 deletions src/components/addpeer/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {getConfig} from "../../config";
const { grpcApiOrigin } = getConfig();


export const formatNetBirdUP = () => {
let cmd = "sudo netbird up"
if (grpcApiOrigin) {
cmd = "sudo netbird up --management-url " + grpcApiOrigin
}
return [
cmd
].join('\n')
}

0 comments on commit 2fa33ec

Please sign in to comment.