-
Notifications
You must be signed in to change notification settings - Fork 0
/
mydebian.sh
127 lines (100 loc) · 4 KB
/
mydebian.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
# mydebian setup
if [ `whoami` = "root" ];then
echo "Start"
else
echo "Please switch to 'root'"
exit
fi
mkdir /dska
mkdir /dska/tmp
LOG_FILE="/dska/tmp/mydebian.log"
>"${LOG_FILE}"
exec &> >(tee "$LOG_FILE")
set -x
echo -e "----------------SETBASE--------------------------\n"
echo "######Reset to default######"
#mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
#wget -O /etc/ssh/sshd_config https://raw.githubusercontent.com/gitlun/mydebian/master/sshd_config
echo "######Update Debian######"
wget -O /tmp/apt.source https://raw.githubusercontent.com/gitlun/mydebian/master/apt.source
cp -f /tmp/apt.source /etc/apt/sources.list
apt update
export DEBIAN_FRONTEND=noninteractive
apt -y full-upgrade
echo -e "######done######\n"
echo "######reconfig locales######"
#sed 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
#locale-gen
#sed 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen
echo "zh_CN.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
echo -e "######done######\n"
echo -e "----------------SETPROJECT--------------------------\n"
echo "######Install sudo######"
apt -y install sudo
echo -e "######done######\n"
echo "######Install webserver######"
#echo "deb http://nginx.org/packages/stable/debian stretch nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
#curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
apt -y install nginx
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
nvm install --lts
npm install pm2 -g
echo -e "######done######\n"
echo "######Install sql######"
apt -y install redis postgresql
echo -e "######done######\n"
echo "######Install docker######"
apt -y install apt-transport-https ca-certificates curl gnupg2 software-properties-common lsb-release
curl -fsSL http://mirrors.163.com/docker-ce/linux/debian/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] http://mirrors.163.com/docker-ce/linux/debian $(lsb_release -cs) stable"
apt update
apt -y install docker-ce docker-ce-cli containerd.io
echo -e "######done######\n"
echo "######Install extrs######"
echo "######Install xfce4######"
apt -y install xfce4 xfce4-goodies lightdm-gtk-greeter-settings
systemctl set-default multi-user.target
echo -e "######done######\n"
echo "######Install vnc######"
apt -y install tigervnc-standalone-server
echo -e "######done######\n"
echo "######Install font######"
apt -y install fonts-wqy-microhei fonts-wqy-zenhei xfonts-wqy
echo -e "######done######\n"
echo "######Install fcitx######"
apt -y install fcitx fcitx-sunpinyin
echo -e "######done######\n"
echo "######Install extrsoft######"
apt -y install firefox-esr openjdk-11-jre-headless
echo -e "######done######\n"
echo "######Install netdata######"
#apt -y install netdata --no-install-recommends
echo -e "######done######\n"
echo -e "----------------CLEAN--------------------------\n"
echo "######Clean######"
apt -y autoremove
apt autoclean
echo -e "######done######\n"
wget -O /etc/ssh/sshd_config https://raw.githubusercontent.com/gitlun/mydebian/master/sshd_config
#docker run -p 9760:9000 --name hi0580php -v /dska/www/hi0580:/var/www/html -v /dska/www/phpconf:/usr/local/etc/php -d hi0580php:1.0
#docker run --name hi0580db -v /dska/www/mysql:/var/lib/mysql -v /dska/www/mysqlbak:/var/www/mysqlbak -e MYSQL_ROOT_PASSWORD=... -d mysql:5.7
#
#echo -e "----------------INSTALL EXTR--------------------------\n"
#echo "######Dbeaver######"
#wget -O /tmp/dbeaver.tar.a http://m.mai0580.com/client/theme/sg/cn/mob/extr/dbeaver.tar.a
#wget -O /tmp/dbeaver.tar.b http://m.mai0580.com/client/theme/sg/cn/mob/extr/dbeaver.tar.b
#wget -O /tmp/dbeaver.tar.c http://m.mai0580.com/client/theme/sg/cn/mob/extr/dbeaver.tar.c
#cd /tmp
#cat dbeaver.tar.* | tar xzvf -
#dpkg -i ./dbeaver-ce_5.3.5_amd64.deb
#cd
#echo -e "######done######\n"
#scp apt.source lun@192.168.1.126:/tmp
#ftp upload weixinsql.zip
#ftp upload hi0580php.1.0.tar and load
#ftp upload weixin.zip and release
#ftp upload Dbeaver and install
#ftp upload www.mai0580 & www.souboat