#!/bin/bash
# 用于离线升级的替换脚本
# -p <pid_or_keyword>:要杀掉的进程的 PID 或者进程关键字。
# -c <compress_dir>:包含压缩文件的目录。
# -u <unzip_dir>:解压文件的目标目录。
# -t <target_dir>:目标目录,解压后的文件将替换该目录下的文件。
# -l <log_file>:日志文件,记录脚本的执行过程。
# 可以这里自然等待退出,退出不了会在下面kill掉
sleep 30
# 脚本帮助信息
usage() {
echo "Usage: \$0 -p <pid_or_keyword> -c <compress_dir> -u <unzip_dir> -t <target_dir> -l <log_file>"
echo " -p <pid_or_keyword> Process ID or keyword to kill"
echo " -c <compress_dir> Directory containing the compressed file"
echo " -u <unzip_dir> Directory to unzip the compressed file to"
echo " -t <target_dir> Directory where files will be replaced"