mirror of https://github.com/EdgeVPNio/portal.git
41 lines
538 B
Bash
Executable File
41 lines
538 B
Bash
Executable File
#!/bin/bash
|
|
|
|
function help()
|
|
{
|
|
echo 'Enter start/stop as argument'
|
|
}
|
|
|
|
function options
|
|
{
|
|
read -p "$(help) `echo $'\n> '`" user_input
|
|
echo $user_input
|
|
}
|
|
|
|
|
|
function start()
|
|
{
|
|
nohup node ./server/Server.js > visualizer.log 2> visualizer.log &
|
|
}
|
|
|
|
function stop()
|
|
{
|
|
ps aux | grep -v grep | grep "node ./server/Server.js" | awk '{print $2}' | xargs kill -9
|
|
}
|
|
|
|
|
|
cmd=$1
|
|
if [[ -z $cmd ]] ; then
|
|
line=($(options))
|
|
cmd=${line[0]}
|
|
fi
|
|
|
|
case $cmd in
|
|
("start")
|
|
start
|
|
;;
|
|
("stop")
|
|
stop
|
|
;;
|
|
esac
|
|
|