#!/bin/sh # --> get the dir of this script SOURCE="${BASH_SOURCE[0]}" # resolve $SOURCE until the file is no longer a symlink while [ -h "$SOURCE" ]; do DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it # relative to the path where the symlink file was located done SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )" # --> set python3 env . $SCRIPT_DIR/set_py3_env.sh > /dev/null 2>&1 # --> decide PY or PYC if [ -e "$HBS_INST_PATH/rr2/bin/pipe_rr2_daemon_setting.pyc" ]; then PY_ENTRY="$HBS_INST_PATH/rr2/bin/pipe_rr2_daemon_setting.pyc" else PY_ENTRY="$HBS_INST_PATH/rr2/bin/pipe_rr2_daemon_setting.py" fi # python3 $PY_ENTRY < /dev/stdin python3 $PY_ENTRY < /proc/self/fd/0 exit 0