feat: add more scrips

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim)
2023-08-21 22:18:21 +08:00
parent f0ad869d29
commit d3364e374f
10 changed files with 295 additions and 165 deletions
+12 -3
View File
@@ -36,12 +36,21 @@ openim::log::install_errexit
# Function to execute the scripts.
function execute_scripts() {
for script_path in "${OPENIM_SERVER_SCRIPT_START_LIST[@]}"; do
# Extract the script name without extension for argument generation.
script_name_with_prefix=$(basename "$script_path" .sh)
# Remove the "openim-" prefix.
script_name=${script_name_with_prefix#openim-}
# Construct the argument based on the script name.
arg="openim::${script_name}::start"
# Check if the script file exists and is executable.
if [[ -x "$script_path" ]]; then
openim::log::status "Starting script: ${script_path##*/}" # Log the script name.
# Execute the script.
"$script_path"
# Execute the script with the constructed argument.
"$script_path" "$arg"
# Check if the script executed successfully.
if [[ $? -eq 0 ]]; then