dotfiles/tools/alpine.sh
Dict Xiong f39193f28f
[core] parse func; gbes; .config/dotfiles/env (#29)
* common.sh: arg parse init

* bug fix

* bug fix

* bug fix. now common.sh won't parse arg autoly

* improve git-branches

* improve git-branches; util-linux

* accelerate ci

* improve gbes; PARSE_ARG_RET

* ci: fix gbes

* ssh: add key ltp1.bd

* Revert "ssh: add key ltp1.bd"

This reverts commit c2433a0549.

* install column; apt -> apt-get

Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
2022-11-17 20:02:35 +08:00

40 lines
847 B
Bash
Executable File

#!/bin/bash
set -e
set_mirror()
{
MIRROR=${1:-"mirrors.tuna.tsinghua.edu.cn"}
MIRROR=${MIRROR//\//\\\/}
sed -i "s/dl-cdn.alpinelinux.org/$MIRROR/g" /etc/apk/repositories
}
apk_add()
{
apk update
# mass installation
apk add zsh git tmux vim curl wget bash python3 py3-pip htop gcc g++ cmake make fzf perl linux-headers bind-tools iputils man-db coreutils util-linux
#for i in {fzf,ripgrep}; do apk add $i -y; done
}
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, set-timezone;;
esac
}
router $@