You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
685 B
Bash
28 lines
685 B
Bash
# linux script framework path about function encapsulation
|
|
# Longwei Lai
|
|
###################################################################
|
|
|
|
source "${____FWK_SCRIPT_PATH}/lnx_fwk_log.sh"
|
|
|
|
if [ -z "${SVR_PATH}" ]; then
|
|
log_err "please define SVR_PATH first"
|
|
exit 1
|
|
fi
|
|
|
|
____FWK_PID_SUFFIX=pid
|
|
____FWK_NOHUP_SUFFIX=nohup
|
|
|
|
# make server pid file path
|
|
function make_server_pid_file_path()
|
|
{
|
|
local svr_name_or_path="$1"
|
|
local path_part="`dirname "${svr_name_or_path}"`"
|
|
local name_part="`basename "${svr_name_or_path}"`"
|
|
if [ "${path_part}" = "." ]; then
|
|
path_part="${SVR_PATH}"
|
|
fi
|
|
|
|
echo -n "${path_part}/.${name_part}.${____FWK_PID_SUFFIX}"
|
|
}
|
|
|