-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmanage.sh
42 lines (36 loc) · 1.23 KB
/
manage.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
###############
# Name: 软件管理脚本
# Params 1: <AliasSoftware> 软件别名
# Params 2: <AliasCommand> 软件命令
# Params 3: <AliasConfig> 配置别名
# author: ZhangTianJie
# email: [email protected]
###############
### 定义帮助文本
if [ "${1}" == "help" ] || [ "${1}" == "" ]; then
echo ">>> params 1 <AliasSoftware>"
echo ">>> params 2 <AliasCommand>[install|init|backup|supervisor|systemd]"
echo ">>> params 3 <AliasConfig>"
exit
fi
### 环境定义
ProjectPathRoot=$(cd $(dirname $(readlink -f ${BASH_SOURCE[0]})) && pwd)
ProjectPathBackup=${ProjectPathRoot}/Backup
ProjectPathBin=${ProjectPathRoot}/Bin
ProjectPathConfig=${ProjectPathRoot}/Config
ProjectPathCustom=${ProjectPathRoot}/Custom
ProjectPathPackage=${ProjectPathRoot}/Package
ProjectPathPlugin=${ProjectPathRoot}/Plugin
ProjectPathShell=${ProjectPathRoot}/Shell
### 引入通用脚本
source ${ProjectPathShell}/Common/Function.sh
### 定义别名变量
AliasSoftware=${1}
AliasCommand=${2}
AliasConfig=${3:-default}
AliasSoftwareMain=$(getStringArrayItem "${1}" "." "0")
AliasSoftwareSub=$(getStringArrayItem "${1}" "." "1")
### 引入管理脚本
source ${ProjectPathShell}/Manage/Variables.sh
source ${ProjectPathShell}/Manage/ExecFlow.sh