Skip to content

Commit

Permalink
Merge pull request #52 from astepchenko/add-atatus
Browse files Browse the repository at this point in the history
Add status to the main script
  • Loading branch information
Acris authored Sep 4, 2023
2 parents 9721353 + c394653 commit b15e23f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ss-merlin start
### Usage
```sh
admin@R7000:/tmp/home/root# ss-merlin
Usage: ss-merlin start|stop|restart|upgrade|uninstall
Usage: ss-merlin start|stop|restart|status|upgrade|uninstall
```

### Custom user rules
Expand Down
14 changes: 13 additions & 1 deletion bin/ss-merlin
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ start_proxy() {
echo -e "$ansi_green Started. $ansi_std"
}

status_proxy() {
set -e

if [[ -f /tmp/ss-merlin-is-run ]]; then
echo -e "$ansi_green Started $ansi_std"
else
echo -e "$ansi_red Stopped $ansi_std"
fi
}

restart_proxy() {
stop_proxy
start_proxy
Expand All @@ -153,10 +163,12 @@ elif [[ "$1" == 'start' ]]; then
start_proxy
elif [[ "$1" == 'restart' ]]; then
restart_proxy
elif [[ "$1" == 'status' ]]; then
status_proxy
elif [[ "$1" == 'upgrade' ]]; then
${SS_MERLIN_HOME}/tools/upgrade.sh
elif [[ "$1" == 'uninstall' ]]; then
${SS_MERLIN_HOME}/tools/uninstall.sh
else
echo -e "$ansi_yellow Usage: ss-merlin start|stop|restart|upgrade|uninstall $ansi_std"
echo -e "$ansi_yellow Usage: ss-merlin start|stop|restart|status|upgrade|uninstall $ansi_std"
fi

0 comments on commit b15e23f

Please sign in to comment.