adding run.sh
Change-Id: I80744b4ac19d51b6f9b7f105f5582b01168b1466
diff --git a/.gitignore b/.gitignore
index 1ec1bcc..0186f5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
.idea
-run.sh
ofagent-go
output
diff --git a/main.go b/main.go
index 7274bcd..1be60a4 100644
--- a/main.go
+++ b/main.go
@@ -1,5 +1,5 @@
/*
- Copyright 2017 the original author or authors.
+ Copyright 2019 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
import (
"flag"
+
"github.com/opencord/ofagent-go/settings"
"github.com/opencord/ofagent-go/grpc"
diff --git a/run.sh b/run.sh
new file mode 100644
index 0000000..3f9942c
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+<<COMMENT
+ Copyright 2019 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+COMMENT
+if [ -z output ]
+then
+ rm output
+fi
+go build -v -o build/ofagent-go -mod=vendor
+
+if [ "$1" = "debug" ]
+then
+ echo DEBUGGING
+ ./build/ofagent-go -memprofile=debugmem -cpuprofile=debugcpu -debug -ofaddress=localhost openflowPort=6653 -volthaAddress=localhost -volthaPort=50057 2>&1 |tee output
+else
+ echo NOT DEBUGGING
+ ./build/ofagent-go -ofaddress=localhost openflowPort=6653 -volthaAddress=localhost -volthaPort=50057 -memprofile=mem -cpuprofile=cpu 2>&1 |tee output
+fi
+