tpm requires make; set-tz; lemonbench

This commit is contained in:
Dict Xiong 2022-05-21 15:08:42 +08:00
parent 861a38255f
commit b504e97598
4 changed files with 23 additions and 5 deletions

View File

@ -190,11 +190,11 @@ install_tmux_tpm(){
if [[ -x $(command -v tmux) && ! -d "$TMUX_TPM" ]]; then
fmt_note "installing tmux tpm ..."
git clone https://hub.fastgit.xyz/tmux-plugins/tpm "$TMUX_TPM"
if [[ -x $(command -v g++) && -x $(command -v cmake) ]]; then
if [[ -x $(command -v g++) && -x $(command -v cmake) && -x $(command -v make) ]]; then
fmt_note "initializing tmux plugins ..."
~/.tmux/plugins/tpm/bin/install_plugins
else
fmt_warning "pls install g++ and cmake and then init tmux plugins by <prefix + I>"
fmt_warning "pls install g++,cmake,make and then init tmux plugins by <prefix + I> or ~/.tmux/plugins/tpm/bin/install_plugins"
fi
fi
}

View File

@ -26,12 +26,21 @@ apk_add()
git config --global user.name "Dict Xiong"
}
set_timezone()
{
apk update
apk add tzdata
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo "Asia/Shanghai" > /etc/timezone
}
router()
{
case $1 in
apk-add ) apk_add ;;
set-timezone | set-tz ) set_timezone ;;
#set-mirror ) set_mirror $2 ;;
* ) echo unknown command "$1". available: apk-add;;
* ) echo unknown command "$1". available: apk-add, set-timezone;;
esac
}

View File

@ -10,6 +10,7 @@ install_commands=(\
[v2ray]="bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) #--remove" \
[zerotier-one]='curl -s https://install.zerotier.com | sudo bash' \
[docker-ce]='curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh #--mirror Aliyun #--dry-run' \
[lemonbench]='curl -fsSL https://ilemonra.in/LemonBenchIntl | bash -s fast # or full' \
)
install()

View File

@ -7,7 +7,7 @@ fi
set_mirror()
{
MIRROR=${1:="mirrors.tuna.tsinghua.edu.cn"}
MIRROR=${1:-"mirrors.tuna.tsinghua.edu.cn"}
MIRROR=${MIRROR//\//\\\/}
sed -i 's/(archive|security).ubuntu.com/${MIRROR}/g' /etc/apt/sources.list
}
@ -28,12 +28,20 @@ apt_install()
git config --global user.name "Dict Xiong"
}
set_timezone()
{
TIMEZONE=${1:-"Asia/Shanghai"}
timedatectl set-timezone "$TIMEZONE"
}
router()
{
case $1 in
apt-install ) apt_install ;;
set-mirror ) set_mirror $2 ;;
* ) echo unknown command "$1". available: apt-install, set-mirror;;
set-timezone\
| set-tz ) set_timezone $2 ;;
* ) echo unknown command "$1". available: apt-install, set-mirror, set-timezone;;
esac
}