This commit is contained in:
陆柯 2023-03-08 09:22:22 +08:00
parent 840b9e9da8
commit 988d31dd22
6 changed files with 9 additions and 9 deletions

View File

@ -2,7 +2,7 @@ PREFIX=%miki
SUFFIX=miki% SUFFIX=miki%
echo sed -i '' "s/$/$SUFFIX/" echo sed -i '' "s/$/$SUFFIX/"
if [[ "$(uname)" = "Darwin" ]] if [ "$(uname)" = "Darwin" ]
then then
LC_CTYPE='C' sed -i '' "s/^/$PREFIX/" $1 LC_CTYPE='C' sed -i '' "s/^/$PREFIX/" $1
LC_CTYPE='C' sed -i '' "s/$/$SUFFIX/" $1 LC_CTYPE='C' sed -i '' "s/$/$SUFFIX/" $1

View File

@ -1,7 +1,7 @@
PREFIX=%miki PREFIX=%miki
SUFFIX=miki% SUFFIX=miki%
if [[ "$(uname)" = "Darwin" ]] if [ "$(uname)" = "Darwin" ]
then then
LC_CTYPE='C' sed -i '' "s/^$PREFIX//" $1 LC_CTYPE='C' sed -i '' "s/^$PREFIX//" $1
LC_CTYPE='C' sed -i '' "s/$SUFFIX$//" $1 LC_CTYPE='C' sed -i '' "s/$SUFFIX$//" $1

View File

@ -15,18 +15,18 @@ else
fi fi
fi fi
if [[ "$(uname)" = "Linux" ]] if [ "$(uname)" = "Linux" ]
then then
# 用 dpkg --print-architecture 更直接 # 用 dpkg --print-architecture 更直接
ARCH=`dpkg --print-architecture` ARCH=`dpkg --print-architecture`
else else
if [[ "$(uname -m)" = "aarch64" ]]; if [ "$(uname -m)" = "aarch64" ]
then then
ARCH=arm64 ARCH=arm64
elif [[ "$(uname -m)" = "armv7l" ]]; elif [ "$(uname -m)" = "armv7l" ]
then then
ARCH=arm ARCH=arm
elif [[ "$(uname -m)" = "x86_64" ]]; elif [ "$(uname -m)" = "x86_64" ]
then then
ARCH=amd64 ARCH=amd64
fi fi

View File

@ -92,7 +92,7 @@ then
echo echo
if [ "$TheUser" != 'root' ] && [[ "$(uname)" != "Darwin" ]] # 仅允许 non-root 用户进行远程密钥登录 if [ "$TheUser" != 'root' ] && [ "$(uname)" != "Darwin" ] # 仅允许 non-root 用户进行远程密钥登录
then then
mkdir -p $HomePath/.ssh mkdir -p $HomePath/.ssh

View File

@ -57,7 +57,7 @@ alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto' alias egrep='egrep --color=auto'
alias su='su -' alias su='su -'
alias npmc='npm --registry https://registry.npm.taobao.org' alias npmc='npm --registry https://registry.npm.taobao.org'
if [[ "$(uname)" = "Darwin" ]]; if [ "$(uname)" = "Darwin" ]
then then
alias l='ls -lG' alias l='ls -lG'
alias ll='ls -lGA' # show .xxx alias ll='ls -lGA' # show .xxx

View File

@ -6,7 +6,7 @@ else
read -p ">>> " PORT read -p ">>> " PORT
fi fi
if [[ "$(uname)" = "Darwin" ]] if [ "$(uname)" = "Darwin" ]
then then
lsof -i tcp:$PORT lsof -i tcp:$PORT
else else