jumpserver/entrypoint.sh

26 lines
431 B
Bash
Raw Normal View History

2018-11-13 07:57:44 +00:00
#!/bin/bash
function cleanup()
{
local pids=`jobs -p`
if [[ "${pids}" != "" ]]; then
kill ${pids} >/dev/null 2>/dev/null
2018-11-13 07:57:44 +00:00
fi
}
2020-12-03 06:01:26 +00:00
action="${1-start}"
service="${2-all}"
2019-01-19 11:29:38 +00:00
trap cleanup EXIT
2022-09-15 04:26:04 +00:00
rm -f /opt/jumpserver/tmp/*.pid
2020-12-03 06:01:26 +00:00
if [[ "$action" == "bash" || "$action" == "sh" ]];then
bash
2021-08-12 09:53:43 +00:00
elif [[ "$action" == "sleep" ]];then
echo "Sleep 365 days"
sleep 365d
else
2020-12-03 06:01:26 +00:00
python jms "${action}" "${service}"
fi
2022-09-21 06:27:09 +00:00