Update debian.sh

This commit is contained in:
Xiufeng Guo 2022-12-17 15:41:28 +11:00
parent 26054cc960
commit a78825fa1a
Signed by: showfom
GPG Key ID: 29A7777777777777

View File

@ -2,8 +2,8 @@
#########################################################
# Function :Initial Server Setup for Debian Server #
# Platform :Debian 11.x Bullseye #
# Version :1.2 #
# Date :06-29-2022 #
# Version :1.3 #
# Date :12-17-2022 #
# Author :Xiufeng Guo #
# Contact :i@m.ac #
# Company :xTom #
@ -111,7 +111,8 @@ function install_packages() {
unzip rsync \
bash-completion git whois \
fail2ban iptables haveged gnupg vnstat lrzsz jq \
unattended-upgrades apt-listchanges
unattended-upgrades apt-listchanges \
htop iftop p7zip-full
printf "\E[0;35;40m"
echo '### Updating system... ###'
printf "\E[0m"
@ -212,6 +213,15 @@ alias ll='ls --color=auto -alF'
alias l='ls -A'
alias mtr='mtr --aslookup --show-ips'
PS1='\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\\$ \[\033[00m\]'
# If this is an xterm set the title to user@host:dir
case "\$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;\${debian_chroot:+(\$debian_chroot)}\u@\h: \w\a\]\$PS1"
;;
*)
;;
esac
EOF
printf "\E[0;33;40m"
echo "### Custom .bashrc added ###"
@ -304,7 +314,7 @@ function add_nginx_repo() {
printf "\E[0;35;40m"
echo '### Add n.wtf Nginx repo ###'
printf "\E[0m"
curl -sS https://raw.githubusercontent.com/u-sb/nginx-docs/main/public/public.key | gpg --dearmor > /usr/share/keyrings/n.wtf.gpg
curl -sS https://n.wtf/public.key | gpg --dearmor > /usr/share/keyrings/n.wtf.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/n.wtf.gpg] https://mirror-cdn.xtom.com/sb/nginx/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/n.wtf.list
printf "\E[0;33;40m"
echo "### n.wtf Nginx repo added ###"
@ -387,7 +397,7 @@ function add_acme_sh() {
printf "\E[0;35;40m"
echo '### Install acme.sh ###'
printf "\E[0m"
curl -sS https://get.acme.sh | bash -s email=david@xtom.com
curl -sS https://get.acme.sh | bash -s email=i@m.ac
/root/.acme.sh/acme.sh --upgrade --auto-upgrade
/root/.acme.sh/acme.sh --set-default-ca --server letsencrypt
printf "\E[0;33;40m"