perf: 按要求移除重复构建代码

This commit is contained in:
吴小白
2024-05-28 10:40:35 +08:00
committed by 老广
parent 91a1da57e9
commit 0b65e3ffda
5 changed files with 120 additions and 241 deletions

View File

@@ -1,26 +1,12 @@
#!/bin/bash
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
elif [[ "$service" == "receptor" ]];then
python receptor "$action"
else
python jms "$action" "$service"
fi
case "$1" in
start|init_db|upgrade_db)
set -- /opt/jumpserver/jms "$@"
;;
esac
exec "$@"