mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 10:27:00 +08:00
Dict Xiong
b6ff4116c8
* rebase zshrc, introduce DFS_NO_WALL * improve ci * improve ci * improve ci * update antigen url for DFS_NO_WALL * OK * improve ci for macos * improve test.zsh * staged * fix ci * fix ci * use local vars * introduce DFS_QUIET * mass mod install.sh * minor change * set DFS_DEV=1 to prevent update * debug: done -> fi * fix DFS_DEV * ubuntu.sh: set-mirror (ref: tuna) * preinstall_check * install.sh: -q to be quiet * install.sh: -d to DFS_DEV Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
40 lines
828 B
Bash
Executable File
40 lines
828 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 htop gcc g++ cmake make fzf perl linux-headers bind-tools iputils man-db coreutils
|
|
#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 $@
|