-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathwdcp.sh
67 lines (60 loc) · 1.69 KB
/
wdcp.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
#!/bin/bash
#
# Wdcp Server Install Script
# Created by wdlinux QQ:12571192
# Url:http://www.wdlinux.cn
# Since 2010.04.08
#
. lib/common.conf
. lib/common.sh
. lib/basic_packages.sh
. lib/mysql.sh
. lib/wdapache.sh
. lib/wdphp.sh
. lib/pureftp.sh
. lib/wdcp.sh
[ -d $IN_SRC ] || mkdir $IN_SRC
[ -d $LOGPATH ] || mkdir $LOGPATH
ping -c 1 -t 1 www.wdlinux.cn >/dev/null 2>&1
if [[ $? == 2 ]]; then
#echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "dns err"
exit
fi
# Get os version info
GetOSVersion
install_basic_packages
ntpdate tiger.sina.com.cn
hwclock -w
if [ ! -d $IN_DIR ]; then
mkdir -p $IN_DIR/{etc,init.d,wdcp_bk}
if is_debian_based; then
ogroup=$(awk -F':' '/x:1000:/ {print $1}' /etc/group)
[ -n "$ogroup" ] && groupmod -g 1010 $ogroup
ouser=$(awk -F':' '/x:1000:/ {print $1}' /etc/passwd)
[ -n "$ouser" ] && usermod -u 1010 -g 1010 $ouser
adduser --system --group --home /nonexistent --no-create-home mysql >/dev/null 2>&1
else
groupadd -g 27 mysql >/dev/null 2>&1
useradd -g 27 -u 27 -d /dev/null -s /sbin/nologin mysql >/dev/null 2>&1
fi
groupadd -g 1000 www >/dev/null 2>&1
useradd -g 1000 -u 1000 -d /dev/null -s /sbin/nologin www >/dev/null 2>&1
###
fi
cd $IN_SRC
wget_down $MYSQL_DU $PHP_DU $EACCELERATOR_DU $PUREFTP_DU $PHPMYADMIN_DU
if [ ! -d /www/wdlinux/wdapache ]; then
if is_rhel_based; then
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
fi
groupadd -g 999 wdcpg >/dev/null 2>&1
useradd -g 999 -u 999 -d /www/wdlinux/wdcp -s /sbin/nologin wdcpu >/dev/null 2>&1
fi
mysql_ins
wdapache_ins
wdphp_ins
pureftpd_ins
wdcp_ins
wdcp_in_finsh