mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-04-27 11:12:54 +00:00
* perf: add cron * Update Dockerfile-base * perf: Update Dockerfile with new base image tag --------- Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
28 lines
555 B
Bash
Executable File
28 lines
555 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# 不能删掉 cleanup 会产生僵尸进程
|
|
function cleanup()
|
|
{
|
|
local pids=`jobs -p`
|
|
if [[ "${pids}" != "" ]]; then
|
|
kill ${pids} >/dev/null 2>/dev/null
|
|
fi
|
|
}
|
|
|
|
action="${1-start}"
|
|
service="${2-all}"
|
|
|
|
trap cleanup EXIT
|
|
|
|
rm -f /opt/jumpserver/tmp/*.pid
|
|
|
|
if [[ "$action" == "bash" || "$action" == "sh" ]];then
|
|
bash
|
|
elif [[ "$action" == "sleep" ]];then
|
|
echo "Sleep 365 days"
|
|
sleep 365d
|
|
else
|
|
which cron &>/dev/null && [[ ! -f /var/run/crond.pid ]] && cron || echo ""
|
|
python jms "${action}" "${service}"
|
|
fi
|