add cwd env

This commit is contained in:
Nachuan Tang
2022-07-02 16:59:50 -04:00
parent bb7b8c8c9b
commit c122d5c1f6
2 changed files with 7 additions and 3 deletions
+2 -2
View File
@@ -1,4 +1,3 @@
source bash_tools/helper.sh
# args:
# $1:
# The IP address you want to query geo info for.
@@ -7,6 +6,8 @@ source bash_tools/helper.sh
# doc for api: https://ip-api.com/docs/api
DOT_FILE_DIR=$(dirname ${BASH_SOURCE[0]})/
source $DOT_FILE_DIR/bash_tools/helper.sh
function ipinfo(){
local api_str="http://ip-api.com/json/$1?fields=query,country,regionName,city,district,zip,isp,org,reverse,mobile,proxy,hosting"
if ! hash python; then
@@ -36,7 +37,6 @@ function dict(){
fi
}
# Linux specific functions
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+5 -1
View File
@@ -1,3 +1,7 @@
# get self-host server ip
SERVERIP=x.useless.pw
ip=$(ifconfig | grep -Po 10.0.0.[01][0-9]+)
$(which ifconfig > /dev/null 2>&1) && \
ip=$(ifconfig | grep -Po "10.0.0.[01][0-9]+")
[ "$ip" != "" ] && SERVERIP=10.0.0.100