Skip to content

Commit

Permalink
fix: fix the bug of system check
Browse files Browse the repository at this point in the history
  • Loading branch information
WGrape committed Feb 11, 2023
1 parent 6a6021d commit ca7b041
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions scripts/adjust_system_param.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cd $ngxwayPath
# Require the common shell scripts.
. $ngxwayPath/scripts/common.sh

# Check the system, only available for Linux and Unix series.
whichSystem=$(printWhichSystem)

# Adjust system parameters to improve the performance of ngxway.
if [ "${whichSystem}" == "Linux" ] ; then
echo $systemParamTemplate1 >> ~/.bashrc
Expand Down
15 changes: 8 additions & 7 deletions scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ function printSignedRequest() {
function printWhichSystem(){
uNames=`uname -s`
osName=${uNames: 0: 4}
if [ "$osName" == "Darwin" ] ; then # Darwin
echo "MacOS"
elif [ "$osName" == "Linux" ] ; then # Linux
echo "Linux"
elif [ "$osName" == "MINGW" ] ; then # MINGW
echo "Windows"
if [ "$osName" == "Darw" ] ; then # Darwin
whichSystem="MacOS"
elif [ "$osName" == "Linu" ] ; then # Linux
whichSystem="Linux"
elif [ "$osName" == "MING" ] ; then # MINGW
whichSystem="Windows"
else
echo "Unknown"
whichSystem="Unknown"
fi
echo $whichSystem
}
# ================================

0 comments on commit ca7b041

Please sign in to comment.