30 lines
473 B
Bash
30 lines
473 B
Bash
|
#!/bin/bash
|
||
|
#set -x
|
||
|
|
||
|
PRG="$0"
|
||
|
while [ -h "$PRG" ]; do
|
||
|
ls=$(ls -ld "$PRG")
|
||
|
link=$(expr "$ls" : '.*-> \(.*\)$')
|
||
|
if expr "$link" : '.*/.*' >/dev/null; then
|
||
|
PRG="$link"
|
||
|
else
|
||
|
PRG=$(dirname "$PRG")/"$link"
|
||
|
fi
|
||
|
done
|
||
|
PRGDIR=$(dirname "$PRG")
|
||
|
|
||
|
#full path
|
||
|
cd $PRGDIR
|
||
|
ROOT_DIR=$(pwd)
|
||
|
cd - >/dev/null
|
||
|
|
||
|
|
||
|
# 加载Python3环境
|
||
|
if [ -f /opt/rh/rh-python38/enable ]; then
|
||
|
source /opt/rh/rh-python38/enable
|
||
|
fi
|
||
|
|
||
|
python $ROOT_DIR/get_system_info.py $1
|
||
|
|
||
|
|