Skip to content

Commit

Permalink
增加了 判断服务是否启用状态
Browse files Browse the repository at this point in the history
  • Loading branch information
ztj1993 committed Nov 27, 2018
1 parent 39c0ad5 commit 7670853
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Shell/Plugin/Supervisor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ function MakeSoftwareConfigFile_supervisor() {

### 默认 Supervisor 流程
function SupervisorSoftware_default(){
# 判断服务是否启用
sudo supervisorctl status > /dev/null 2>&1
[ $? -ne 0 ] && echo ">>>>> Warning: supervisord is not available" && return 1
# 备份配置文件
[ -f ${ConfigFileSupervisor} ] && BackupSoftwareConfigFile_supervisor
# 生成配置文件
Expand Down
3 changes: 3 additions & 0 deletions Shell/Plugin/Systemd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ function MakeSoftwareConfigFile_systemd() {

### 默认 Systemd 流程
function SystemdSoftware_default(){
# 判断服务是否启用
sudo systemctl status > /dev/null 2>&1
[ $? -ne 0 ] && echo ">>>>> Warning: systemd is not available" && return 1
# 备份配置文件
[ -f ${ConfigFileSystemd} ] && BackupSoftwareConfigFile_systemd
# 生成配置文件
Expand Down

0 comments on commit 7670853

Please sign in to comment.