From c3d64faad385dfcea32195ff85c24ecee2887ad5 Mon Sep 17 00:00:00 2001 From: Yuki Adachi Date: Sun, 30 Apr 2023 08:15:24 +0900 Subject: [PATCH] Same json format - message - name - type - version - port - dataDir - confPath --- mysql/create.sh | 10 +++++++++- mysql/delete.sh | 11 ++++++++++- mysql/start.sh | 5 ++--- mysql/stop.sh | 10 +++++++++- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/mysql/create.sh b/mysql/create.sh index 793b8c3..3a691ea 100755 --- a/mysql/create.sh +++ b/mysql/create.sh @@ -82,7 +82,15 @@ normalOutputs="${normalOutputs}MySQL Successfully created. $optName $optVersion normalOutputs="${normalOutputs}$commands\n" jsonOutputs="" -jsonOutputs="$jsonOutputs{\"message\": \"MySQL Successfully created.\", \"name\": \"$optName\", \"version\": \"$optVersion\", \"port\": \"$optPort\", \"confPath\": \"$dir/datadir/$optName/my.cnf\", \"commands\": $commands}" +jsonOutputs="$jsonOutputs{ + \"message\": \"MySQL Successfully created.\", + \"name\": \"$optName\", + \"type\": \"mysql\", + \"version\": \"$optVersion\", + \"port\": \"$optPort\", + \"dataDir\": \"$dir/datadir/$optName\", + \"confPath\": \"$dir/datadir/$optName/my.cnf\" +}" # Output if [ "$format" = "json" ]; then diff --git a/mysql/delete.sh b/mysql/delete.sh index d260b28..1549b74 100755 --- a/mysql/delete.sh +++ b/mysql/delete.sh @@ -47,7 +47,16 @@ normalOutputs="" normalOutputs="${normalOutputs}MySQL Successfully deleted. $optName $optVersion $optPort" jsonOutputs="" -jsonOutputs="$jsonOutputs{\"message\": \"MySQL Successfully deleted.\", \"name\": \"$optName\", \"version\": \"$optVersion\", \"port\": \"$optPort\"}" +jsonOutputs="$jsonOutputs{ + \"message\": \"MySQL Successfully deleted.\", + \"name\": \"$optName\", + \"type\": \"mysql\", + \"version\": \"$optVersion\", + \"port\": \"$optPort\", + \"dataDir\": \"$dir/datadir/$optName\", + \"confPath\": \"$dir/datadir/$optName/my.cnf\" +}" + # Output if [ "$format" = "json" ]; then diff --git a/mysql/start.sh b/mysql/start.sh index 7f978a3..8ca8205 100755 --- a/mysql/start.sh +++ b/mysql/start.sh @@ -62,12 +62,11 @@ jsonOutputs="" jsonOutputs="$jsonOutputs{ \"message\": \"MySQL Successfully started.\", \"name\": \"$optName\", + \"type\": \"mysql\", \"version\": \"$optVersion\", \"port\": \"$optPort\", - \"confPath\": \"$dir/datadir/$optName/my.cnf\", \"dataDir\": \"$dir/datadir/$optName\", - \"logError\": \"$dir/datadir/$optName/mysqld.err\", - \"pidFile\": \"$dir/datadir/$optName/mysql.pid\" + \"confPath\": \"$dir/datadir/$optName/my.cnf\" }" # Output diff --git a/mysql/stop.sh b/mysql/stop.sh index 4b3e7de..698da5d 100755 --- a/mysql/stop.sh +++ b/mysql/stop.sh @@ -48,7 +48,15 @@ normalOutputs="" normalOutputs="${normalOutputs}MySQL Successfully stopped. $optName $optVersion $optPort" jsonOutputs="" -jsonOutputs="$jsonOutputs{\"message\": \"MySQL Successfully stopped.\", \"name\": \"$optName\", \"version\": \"$optVersion\", \"port\": \"$optPort\", \"confPath\": \"$dir/datadir/$optName/my.cnf\"}" +jsonOutputs="$jsonOutputs{ + \"message\": \"MySQL Successfully stopped.\", + \"name\": \"$optName\", + \"type\": \"mysql\", + \"version\": \"$optVersion\", + \"port\": \"$optPort\", + \"dataDir\": \"$dir/datadir/$optName\", + \"confPath\": \"$dir/datadir/$optName/my.cnf\" +}" # Output if [ "$format" = "json" ]; then