This commit is contained in:
luk
2026-06-21 06:02:06 +08:00
parent 812612d710
commit 8ae24c96a3
2 changed files with 10 additions and 8 deletions

View File

@@ -106,6 +106,8 @@ esac
# $Style: text style
# - `00`: Default style
# - `01`: Bold/Bright
# - `02`:
# - `03`: Italic
# - `04`: Underlined
# - `05`: Blink (may not work in all terminals)
# - `07`: Inverse
@@ -128,15 +130,15 @@ esac
MYIPPUB=$(curl -s ifconfig.me)
if [ "$(uname)" = "Darwin" ]; then
PSTYLE=07
PTYPE=3
PSTYLE=00
PTYPE=4
elif [ "$(whoami)" = "root" ]; then
PSTYLE=07
PTYPE=4
AS_ROOT="#"
else
PSTYLE=07
PTYPE=3
PSTYLE=03
PTYPE=4
if [[ -n "$SSH_CONNECTION" ]]; then
IN_SSH="$"
fi
@@ -151,9 +153,9 @@ elif [ -f /etc/ubuntu_version ]; then
MYOSVERSION=Ubt`cat /etc/ubuntu_version 2>/dev/null`
fi
if [ "$color_prompt" = yes ]; then
PS1='<\[\033[$PSTYLE;${PTYPE}2m\]\t\[\033[00m\] #\[\033[$PSTYLE;${PTYPE}4m\]$MYIPPUB\[\033[00m\] ^\[\033[$PSTYLE;${PTYPE}5m\]$(uname -m),$(uname),$MYOSVERSION\[\033[00m\] %\[\033[$PSTYLE;${PTYPE}2m\]\w\[\033[00m\]>\n<\[\033[$PSTYLE;${PTYPE}5m\]\u\[\033[00m\] @\[\033[$PSTYLE;${PTYPE}1m\]\h\[\033[00m\] %\[\033[$PSTYLE;${PTYPE}2m\]\W\[\033[00m\]> '
PS1='<\[\033[$PSTYLE;${PTYPE}2m\]\t\[\033[00m\] \[\033[$PSTYLE;${PTYPE}5m\]\u\[\033[00m\] @\[\033[$PSTYLE;${PTYPE}1m\]\h\[\033[00m\] #\[\033[$PSTYLE;${PTYPE}6m\]$MYIPPUB\[\033[00m\] ^\[\033[$PSTYLE;${PTYPE}5m\]$(uname -m),$(uname),$MYOSVERSION\[\033[00m\] %\[\033[$PSTYLE;${PTYPE}2m\]\w\[\033[00m\]>\n[\[\033[05;44m\]\W/\[\033[00m\]] '
else
PS1='<\t #$MYIPPUB ^$(uname -m),$(uname),$MYOSVERSION %\w>\n<\u @\h %\W> ' # \w shows absolute path, \W shows current folder.
PS1='<\t \u @\h #$MYIPPUB ^$(uname -m),$(uname),$MYOSVERSION %\w>\n[\W/] ' # \w shows absolute path, \W shows current folder.
fi
unset color_prompt force_color_prompt

View File

@@ -11,10 +11,10 @@ fi
# to reset port to empty, otherwise the second run of this script will not ask for port.
PORT=
PORTDEFAULT=7897
PORTDEFAULT=17891
# function proxy() {
if [ "$proxySwitch" == "s" ] || [ "$proxySwitch" == "1" ]; then
echo "::*** Proxy server running on [port number] or [leave blank] for default $PORTDEFAULT (20170 for v2ray2, 7897 for 零点云 or clash verge)"
echo "::*** Proxy server running on [port number] or [leave blank] for default $PORTDEFAULT (20170 for v2ray2, 17891 for 零点云, 7897 for clash verge)"
while [ ! "$PORT" ]
do
read -p "***:: " PORT