dotfiles/tools/ubuntu.sh
Dict Xiong 300b3a29b7
install.sh: cmake, less, and -l=DFS_LITE (#23)
* install.sh: cmake and less

* install.sh: -l=DFS_LITE

* ci: support -l=DFS_LITE

Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
2022-11-09 23:19:55 +08:00

42 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
set -e
set_mirror()
{
MIRROR=${1:-"mirrors.tuna.tsinghua.edu.cn"}
MIRROR=${MIRROR//\//\\\/}
sed -i "s@http://.*archive.ubuntu.com@https://${MIRROR}@g" /etc/apt/sources.list
sed -i "s@http://.*security.ubuntu.com@https://${MIRROR}@g" /etc/apt/sources.list
}
apt_install()
{
# basic packages
apt update
for i in {man-db,vim,ca-certificates}; do apt install $i -y; done
# mass installation
apt install git tmux zsh curl wget dialog net-tools dnsutils netcat traceroute sudo python3 python3-pip cron inetutils-ping openssh-client openssh-server htop gcc g++ cmake make zip less
for i in {fzf,ripgrep}; do apt install $i -y; done
}
set_timezone()
{
TIMEZONE=${1:-"Asia/Shanghai"}
timedatectl set-timezone "$TIMEZONE"
}
router()
{
case $1 in
apt-install ) apt_install ;;
set-mirror ) set_mirror $2 ;;
set-timezone\
| set-tz ) set_timezone $2 ;;
* ) echo unknown command "$1". available: apt-install, set-mirror, set-timezone;;
esac
}
router $@