jumpserver/entrypoint.sh

27 lines
476 B
Bash
Raw Normal View History

2018-11-13 07:57:44 +00:00
#!/bin/bash
2022-11-15 09:24:56 +00:00
2024-08-15 12:09:55 +00:00
# 不能删掉 cleanup 会产生僵尸进程
function cleanup()
{
local pids=`jobs -p`
if [[ "${pids}" != "" ]]; then
kill ${pids} >/dev/null 2>/dev/null
fi
}
action="${1-start}"
service="${2-all}"
2022-11-15 09:24:56 +00:00
2024-08-15 12:09:55 +00:00
trap cleanup EXIT
rm -f /opt/jumpserver/tmp/*.pid
2024-08-15 12:09:55 +00:00
if [[ "$action" == "bash" || "$action" == "sh" ]];then
bash
elif [[ "$action" == "sleep" ]];then
echo "Sleep 365 days"
sleep 365d
else
python jms "${action}" "${service}"
fi