diff --git a/files/nanorc b/files/nanorc new file mode 100644 index 0000000..65ccf90 --- /dev/null +++ b/files/nanorc @@ -0,0 +1,5 @@ +set nohelp +set tabsize 4 +set autoindent +set tabstospaces +# set linenumbers diff --git a/init_root.sh b/init_root.sh index c8fa2ca..482b2ec 100755 --- a/init_root.sh +++ b/init_root.sh @@ -9,9 +9,11 @@ check_google_access() { if [ "$response" -eq 200 ]; then echo "Internet: abroad" abroad=1 + github="https://github.com" else echo "Internet: internal" abroad=0 + github="https://g.nano.ac/https://github.com" fi } @@ -34,6 +36,50 @@ configure_ssh_keygen() { fi } +configure_nano() { + read -p "要配置 nano 吗?[Y/n]: " response + + if [[ -z "$response" ]] || [[ $response =~ ^[Yy]$ ]]; then + apt install nano -y + cp $scriptdir/files/nanorc ~/.nanorc + fi +} + +configure_install_bin() { + apt update + apt upgrade -y + apt autoremove -y + apt install tmux git curl htop net-tools tcptraceroute ifupdown tar unzip -y + apt install hexyl bat neofetch fd-find fzf -y + + apt install exa -y + if [ $? -ne 0 ]; then + cd $tempdir + wget -O exa.zip "$(github)/ogham/exa/releases/download/v0.10.1/exa-linux-x86_64-v0.10.1.zip" + unzip exa.zip -d exa + cp exa/bin/* /usr/local/bin/ + cp exa/man/* /usr/share/man/man1/ + cp exa/completions/exa.zsh /usr/local/share/zsh/site-functions + rm exa -r + rm exa.zip + cd - + fi +} + +configure_zsh() { + read -p "要配置 zsh 吗?[Y/n]: " response + + if [[ -z "$response" ]] || [[ $response =~ ^[Yy]$ ]]; then + apt install zsh -y + # touch -p ~/.ssh + # read -p "sshkey 的名字: " sshkeyname + # ssh-keygen -t ed25519 -C $sshkeyname + fi +} + check_google_access configure_ssh configure_ssh_keygen +configure_nano +configure_install_bin +configure_zsh