Update ubuntu.sh

This commit is contained in:
Mr Chen
2024-07-24 13:43:15 +08:00
parent 82a0fde37c
commit 5e9b5466a6
+15 -3
View File
@@ -26,9 +26,21 @@ apt install -y libncurses5
apt install -y libncurses5-dev
apt install -y software-properties-common
apt install -y locate
locale-gen en_US.UTF-8
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
# choose lang cmd
# dpkg-reconfigure --frontend=noninteractive locales
# dpkg-reconfigure locales
if [ ! -f /usr/sbin/locale-gen ];then
apt install -y locales
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
locale-gen en_US.UTF-8
locale-gen zh_CN.UTF-8
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 > /dev/null 2>&1
update-locale LANG=en_US.UTF-8
else
locale-gen en_US.UTF-8
locale-gen zh_CN.UTF-8
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 > /dev/null 2>&1
fi
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then