jumpserver/entrypoint.sh

26 lines
496 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-11-15 09:24:56 +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
2024-04-09 07:38:52 +00:00
elif [[ "$service" == "receptor" ]];then
python receptor "$action"
else
2024-04-09 07:38:52 +00:00
python jms "$action" "$service"
fi