mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
commit
caec3b555e
10 changed files with 183 additions and 184 deletions
|
@ -34,48 +34,72 @@ is_ip_valid "$ip"
|
|||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Changing nat ip
|
||||
# Updating IP
|
||||
if [ -z "$(grep NAT= $VESTA/data/ips/$ip)" ]; then
|
||||
sed -i "s/^TIME/NAT='$nat_ip'\nTIME/g" $VESTA/data/ips/$ip
|
||||
old=''
|
||||
new=$nat_ip
|
||||
else
|
||||
update_ip_value '$NAT' "$nat_ip"
|
||||
fi
|
||||
|
||||
# Check ftp system
|
||||
if [ "$FTP_SYSTEM" = 'vsftpd' ]; then
|
||||
|
||||
# Find configuration
|
||||
if [ -e '/etc/vsftpd/vsftpd.conf' ]; then
|
||||
conf='/etc/vsftpd/vsftpd.conf'
|
||||
fi
|
||||
|
||||
if [ -e '/etc/vsftpd.conf' ]; then
|
||||
conf='/etc/vsftpd.conf'
|
||||
fi
|
||||
|
||||
# Update config
|
||||
if [ -z "$(grep pasv_address $conf)" ]; then
|
||||
if [ ! -z "$nat_ip" ]; then
|
||||
echo "pasv_address=$nat_ip" >> $conf
|
||||
fi
|
||||
else
|
||||
if [ ! -z "$nat_ip" ]; then
|
||||
sed -i "s/pasv_address=.*/pasv_address='$nat_ip'/g" $conf
|
||||
else
|
||||
sed -i "/pasv_address/d" $conf
|
||||
fi
|
||||
old=$(get_ip_value '$NAT')
|
||||
new=$nat_ip
|
||||
sed -i "s/NAT=.*/NAT='$new'/" $VESTA/data/ips/$ip
|
||||
if [ -z "$nat_ip" ]; then
|
||||
new=$ip
|
||||
fi
|
||||
fi
|
||||
|
||||
# Updating WEB configs
|
||||
if [ ! -z "$old" ] && [ ! -z "$WEB_SYSTEM" ]; then
|
||||
sed -i "s/$old/$new/" $VESTA/data/users/*/web.conf
|
||||
for user in $(ls $VESTA/data/users/); do
|
||||
$BIN/v-rebuild-web-domains $user no
|
||||
done
|
||||
$BIN/v-restart-dns $restart
|
||||
fi
|
||||
|
||||
# Updating DNS configs
|
||||
if [ ! -z "$old" ] && [ ! -z "$DNS_SYSTEM" ]; then
|
||||
sed -i "s/$old/$new/" $VESTA/data/users/*/dns.conf
|
||||
sed -i "s/$old/$new/" $VESTA/data/users/*/dns/*.conf
|
||||
for user in $(ls $VESTA/data/users/); do
|
||||
$BIN/v-rebuild-dns-domains $user no
|
||||
done
|
||||
$BIN/v-restart-dns $restart
|
||||
fi
|
||||
|
||||
# Updating FTP
|
||||
if [ ! -z "$old" ] && [ ! -z "$FTP_SYSTEM" ]; then
|
||||
conf=$(find /etc -name $FTP_SYSTEM.conf)
|
||||
if [ -e "$conf" ]; then
|
||||
sed -i "s/$old/$new/g" $conf
|
||||
if [ "$FTP_SYSTEM" = 'vsftpd' ]; then
|
||||
check_pasv=$(grep pasv_address $conf)
|
||||
if [ -z "$check_pasv" ] && [ ! -z "$nat_ip" ]; then
|
||||
echo "pasv_address=$nat_ip" >> $conf
|
||||
fi
|
||||
if [ ! -z "$check_pasv" ] && [ -z "$nat_ip" ]; then
|
||||
sed -i "/pasv_address/d" $conf
|
||||
fi
|
||||
if [ ! -z "$check_pasv" ] && [ ! -z "$nat_ip" ]; then
|
||||
sed -i "s/pasv_address=.*/pasv_address='$nat_ip'/g" $conf
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
$BIN/v-restart-ftp $restart
|
||||
fi
|
||||
|
||||
# Updating firewall
|
||||
if [ ! -z "$old" ] && [ ! -z "$FIREWALL_SYSTEM" ]; then
|
||||
sed -i "s/$old/$new/g" $VESTA/data/firewall/*.conf
|
||||
$BIN/v-update-firewall
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Restart ftp server
|
||||
$BIN/v-restart-ftp $restart
|
||||
check_result $? "FTP restart failed" >/dev/null
|
||||
|
||||
# Logging
|
||||
log_history "changed associated nat address on $ip to $nat_ip" '' 'admin'
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
|
|
|
@ -49,7 +49,7 @@ is_ip_valid "$ip" "$user"
|
|||
# Preparing variables for vhost replace
|
||||
get_domain_values 'web'
|
||||
old=$(get_real_ip $IP)
|
||||
new=$ip
|
||||
new=$(get_real_ip $ip)
|
||||
|
||||
# Replacing vhost
|
||||
replace_web_config "$WEB_SYSTEM" "$TPL.tpl"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
# info: update system ip
|
||||
# options: [USER] [IP_STATUS]
|
||||
# options: [NONE]
|
||||
#
|
||||
# The function scans configured ip in the system and register them with vesta
|
||||
# internal database. This call is intended for use on vps servers, where ip is
|
||||
|
@ -11,14 +11,11 @@
|
|||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument definition
|
||||
user=${1-admin}
|
||||
ip_status=${2-shared}
|
||||
# Importing system variables
|
||||
source /etc/profile
|
||||
|
||||
# Includes
|
||||
source /etc/profile.d/vesta.sh
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/func/ip.sh
|
||||
source $VESTA/conf/vesta.conf
|
||||
|
||||
|
||||
|
@ -26,87 +23,84 @@ source $VESTA/conf/vesta.conf
|
|||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '0' "$#" '[USER] [IP_STATUS]'
|
||||
is_format_valid 'user' 'ip_status'
|
||||
is_object_valid 'user' 'USER' "$user" "$user"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Get list of ip addresses
|
||||
ip_list=$(/sbin/ip addr|grep 'inet '|grep global|awk '{print $2}')
|
||||
ip_list=$(echo "$ip_list"|cut -f 1 -d /)
|
||||
ip_num=$(echo "$ip_list" | wc -l)
|
||||
# Listing system ip addresses
|
||||
ips=$(/sbin/ip addr |grep 'inet ' |grep global |awk '{print $2}' |cut -f1 -d/)
|
||||
v_ips=$(ls $VESTA/data/ips/)
|
||||
ip_num=$(echo "$ips" |wc -l)
|
||||
v_ip_num=$(echo "$v_ips" |wc -l)
|
||||
|
||||
# WorkAround for DHCP IP address
|
||||
vst_ip_list=$(ls $VESTA/data/ips/)
|
||||
vst_ip_num=$(echo "$vst_ip_list" | wc -l)
|
||||
|
||||
if [ ! -z "$vst_ip_list" ] && [ "$vst_ip_num" -eq '1' ]; then
|
||||
if [ $ip_num -eq 1 ] && [ "$ip_list" != "$vst_ip_list" ]; then
|
||||
new=$ip_list
|
||||
old=$vst_ip_list
|
||||
mv $VESTA/data/ips/$old $VESTA/data/ips/$new
|
||||
if [ ! -z "$PROXY_SYSTEM" ]; then
|
||||
mv /etc/$PROXY_SYSTEM/conf.d/$old.conf \
|
||||
/etc/$PROXY_SYSTEM/conf.d/$new.conf
|
||||
sed -i "s/$old/$new/g" /etc/$PROXY_SYSTEM/conf.d/$new.conf
|
||||
fi
|
||||
if [ ! -z "$WEB_SYSTEM" ]; then
|
||||
mv /etc/$WEB_SYSTEM/conf.d/$old.conf \
|
||||
/etc/$WEB_SYSTEM/conf.d/$new.conf
|
||||
sed -i "s/$old/$new/g" /etc/$WEB_SYSTEM/conf.d/$new.conf
|
||||
sed -i "s/$old/$new/g" $VESTA/data/users/*/web.conf
|
||||
|
||||
# Rebuild web domains
|
||||
for user in $(ls $VESTA/data/users/); do
|
||||
$BIN/v-rebuild-web-domains $user no
|
||||
done
|
||||
fi
|
||||
if [ ! -z "$FTP_SYSTEM" ];then
|
||||
ftpd_conf_file=$(find /etc/ -maxdepth 2 -name $FTP_SYSTEM.conf)
|
||||
sed -i "s/$old/$new/g" $ftpd_conf_file
|
||||
fi
|
||||
|
||||
# Restarting web server
|
||||
$BIN/v-restart-web
|
||||
|
||||
# Restarting ftp server
|
||||
$BIN/v-restart-ftp
|
||||
|
||||
# Restarting proxy server
|
||||
if [ ! -z "$PROXY_SYSTEM" ]; then
|
||||
$BIN/v-restart-proxy
|
||||
fi
|
||||
|
||||
# Restarting firewall
|
||||
if [ ! -z "$FIREWALL_SYSTEM" ]; then
|
||||
$BIN/v-update-firewall
|
||||
fi
|
||||
|
||||
if [ ! -z "$DNS_SYSTEM" ]; then
|
||||
# Rebuild dns domains
|
||||
for user in $(ls $VESTA/data/users/); do
|
||||
sed -i "s/$old/$new/g" $VESTA/data/users/$user/dns.conf
|
||||
sed -i "s/$old/$new/g" $VESTA/data/users/$user/dns/*.conf
|
||||
$BIN/v-rebuild-dns-domains $user no
|
||||
done
|
||||
$BIN/v-restart-dns
|
||||
check_result $? "dns restart failed" >/dev/null
|
||||
fi
|
||||
|
||||
# No further comparation is needed
|
||||
exit
|
||||
# Checking primary IP change
|
||||
if [[ "$ip_num" -eq '1' ]] && [[ "$v_ip_num" -eq 1 ]]; then
|
||||
if [ "$ips" != "$v_ips" ]; then
|
||||
new=$ips
|
||||
old=$v_ips
|
||||
fi
|
||||
fi
|
||||
|
||||
# Compare ips
|
||||
for ip in $ip_list; do
|
||||
# Updating configs
|
||||
if [ ! -z "$new" ]; then
|
||||
mv $VESTA/data/ips/$old $VESTA/data/ips/$new
|
||||
|
||||
# Updating PROXY
|
||||
if [ ! -z "$PROXY_SYSTEM" ]; then
|
||||
cd /etc/$PROXY_SYSTEM/conf.d
|
||||
if [ -e "$old.conf" ]; then
|
||||
mv $old.conf $new.conf
|
||||
sed -i "s/$old/$new/g" $new.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
# Updating WEB
|
||||
if [ ! -z "$WEB_SYSTEM" ]; then
|
||||
cd /etc/$WEB_SYSTEM/conf.d
|
||||
if [ -e "$old.conf" ]; then
|
||||
mv $old.conf $new.conf
|
||||
sed -i "s/$old/$new/g" $new.conf
|
||||
fi
|
||||
sed -i "s/$old/$new/g" $VESTA/data/users/*/web.conf
|
||||
for user in $(ls $VESTA/data/users/); do
|
||||
$BIN/v-rebuild-web-domains $user no
|
||||
done
|
||||
$BIN/v-restart-proxy
|
||||
$BIN/v-restart-web
|
||||
fi
|
||||
|
||||
# Updating DNS
|
||||
if [ ! -z "$DNS_SYSTEM" ]; then
|
||||
sed -i "s/$old/$new/g" $VESTA/data/users/*/dns.conf
|
||||
sed -i "s/$old/$new/g" $VESTA/data/users/*/dns/*.conf
|
||||
for user in $(ls $VESTA/data/users/); do
|
||||
$BIN/v-rebuild-dns-domains $user no
|
||||
done
|
||||
$BIN/v-restart-dns
|
||||
fi
|
||||
|
||||
# Updating FTP
|
||||
if [ ! -z "$FTP_SYSTEM" ] && [ "$FTP_SYSTEM" = 'vsftpd' ]; then
|
||||
conf=$(find /etc/ -maxdepth 2 -name $FTP_SYSTEM.conf)
|
||||
if [ ! -z "$conf" ]; then
|
||||
sed -i "s/$old/$new/g" $conf
|
||||
$BIN/v-restart-ftp
|
||||
fi
|
||||
fi
|
||||
|
||||
# Updating firewall
|
||||
if [ ! -z "$FIREWALL_SYSTEM" ]; then
|
||||
sed -i "s/$old/$new/g" $VESTA/data/firewall/*.conf
|
||||
$BIN/v-update-firewall
|
||||
fi
|
||||
fi
|
||||
|
||||
# Adding system IP
|
||||
for ip in $ips; do
|
||||
check_ifconfig=$(/sbin/ifconfig |grep "$ip")
|
||||
if [ ! -e "$VESTA/data/ips/$ip" ] && [ ! -z "$check_ifconfig" ]; then
|
||||
interface=$(/sbin/ip addr |grep $ip |awk '{print $NF}'|uniq)
|
||||
interface=$(/sbin/ip addr |grep $ip |awk '{print $NF}' |uniq)
|
||||
interface=$(echo "$interface" |cut -f 1 -d : |head -n 1)
|
||||
netmask=$(/sbin/ip addr |grep $ip |cut -f 2 -d / |cut -f 1 -d \ )
|
||||
netmask=$(convert_cidr $netmask)
|
||||
|
@ -114,12 +108,11 @@ for ip in $ip_list; do
|
|||
fi
|
||||
done
|
||||
|
||||
# Checking NAT
|
||||
# Updating NAT
|
||||
pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
|
||||
if [ ! -z "$pub_ip" ] && [ ! -e "$VESTA/data/ips/$pub_ip" ]; then
|
||||
check_nat=$(grep -R "$pub_ip" $VESTA/data/ips/)
|
||||
if [ -z "$check_nat" ]; then
|
||||
ip=$(ls -t $VESTA/data/ips/|head -n1)
|
||||
if [ ! -e "$VESTA/data/ips/$pub_ip" ]; then
|
||||
if [ -z "$(grep -R "$pub_ip" $VESTA/data/ips/)" ]; then
|
||||
ip=$(ls -t $VESTA/data/ips/ |head -n1)
|
||||
$BIN/v-change-sys-ip-nat $ip $pub_ip
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
* @version 1.0
|
||||
* @author Serghey Rodin <skid@vestacp.com>
|
||||
*/
|
||||
|
||||
function password_save($curpass, $passwd)
|
||||
class rcube_vesta_password
|
||||
{
|
||||
function save($curpass, $passwd)
|
||||
{
|
||||
$rcmail = rcmail::get_instance();
|
||||
$vesta_host = $rcmail->config->get('password_vesta_host');
|
||||
|
@ -69,3 +70,4 @@
|
|||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -6,8 +6,8 @@
|
|||
* @version 1.0
|
||||
* @author Serghey Rodin <skid@vestacp.com>
|
||||
*/
|
||||
|
||||
function password_save($curpass, $passwd)
|
||||
class rcube_vesta_password {
|
||||
function save($curpass, $passwd)
|
||||
{
|
||||
$rcmail = rcmail::get_instance();
|
||||
$vesta_host = $rcmail->config->get('password_vesta_host');
|
||||
|
@ -69,3 +69,4 @@
|
|||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -6,8 +6,9 @@
|
|||
* @version 1.0
|
||||
* @author Serghey Rodin <skid@vestacp.com>
|
||||
*/
|
||||
|
||||
function password_save($curpass, $passwd)
|
||||
class rcube_vesta_password
|
||||
{
|
||||
function save($curpass, $passwd)
|
||||
{
|
||||
$rcmail = rcmail::get_instance();
|
||||
$vesta_host = $rcmail->config->get('password_vesta_host');
|
||||
|
@ -69,3 +70,4 @@
|
|||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -6,8 +6,8 @@
|
|||
* @version 1.0
|
||||
* @author Serghey Rodin <skid@vestacp.com>
|
||||
*/
|
||||
|
||||
function password_save($curpass, $passwd)
|
||||
class rcube_vesta_password {
|
||||
function save($curpass, $passwd)
|
||||
{
|
||||
$rcmail = rcmail::get_instance();
|
||||
$vesta_host = $rcmail->config->get('password_vesta_host');
|
||||
|
@ -69,3 +69,4 @@
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @version 1.0
|
||||
* @author Serghey Rodin <skid@vestacp.com>
|
||||
*/
|
||||
|
||||
function password_save($curpass, $passwd)
|
||||
class rcube_vesta_password {
|
||||
function save($curpass, $passwd)
|
||||
{
|
||||
$rcmail = rcmail::get_instance();
|
||||
$vesta_host = $rcmail->config->get('password_vesta_host');
|
||||
|
@ -69,3 +69,4 @@
|
|||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -18,45 +18,24 @@ release="$(lsb_release -s -r)"
|
|||
codename="$(lsb_release -s -c)"
|
||||
vestacp="$VESTA/install/$VERSION/$release"
|
||||
|
||||
if [ "$release" = '16.04' ] || [ "$release" = '18.04' ]; then
|
||||
software="nginx apache2 apache2-utils apache2.2-common
|
||||
apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf
|
||||
libapache2-mod-fcgid libapache2-mod-php php php-common php-cgi
|
||||
php-mysql php-curl php-fpm php-pgsql awstats webalizer vsftpd
|
||||
proftpd-basic bind9 exim4 exim4-daemon-heavy clamav-daemon
|
||||
spamassassin dovecot-imapd dovecot-pop3d roundcube-core
|
||||
roundcube-mysql roundcube-plugins mysql-server mysql-common
|
||||
mysql-client postgresql postgresql-contrib phppgadmin phpmyadmin mc
|
||||
flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
|
||||
e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
|
||||
bsdmainutils cron vesta vesta-nginx vesta-php expect vim-common
|
||||
vesta-ioncube vesta-softaculous apparmor-utils"
|
||||
elif [ "$release" = '16.10' ] || [ "$release" = '17.10' ]; then
|
||||
software="nginx apache2 apache2-utils apache2.2-common
|
||||
apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf
|
||||
libapache2-mod-fcgid libapache2-mod-php7.0 php7.0 php7.0-common
|
||||
php7.0-cgi php7.0-mysql php7.0-curl php7.0-fpm php7.0-pgsql awstats
|
||||
webalizer vsftpd proftpd-basic bind9 exim4 exim4-daemon-heavy
|
||||
clamav-daemon spamassassin dovecot-imapd dovecot-pop3d roundcube-core
|
||||
roundcube-mysql roundcube-plugins mysql-server mysql-common
|
||||
mysql-client postgresql postgresql-contrib phppgadmin phpmyadmin mc
|
||||
flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
|
||||
e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
|
||||
bsdmainutils cron vesta vesta-nginx vesta-php expect vim-common
|
||||
vesta-ioncube vesta-softaculous apparmor-utils"
|
||||
else
|
||||
software="nginx apache2 apache2-utils apache2.2-common
|
||||
apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf
|
||||
libapache2-mod-fcgid libapache2-mod-php5 php5 php5-common php5-cgi
|
||||
php5-mysql php5-curl php5-fpm php5-pgsql awstats webalizer vsftpd
|
||||
proftpd-basic bind9 exim4 exim4-daemon-heavy clamav-daemon
|
||||
spamassassin dovecot-imapd dovecot-pop3d roundcube-core
|
||||
roundcube-mysql roundcube-plugins mysql-server mysql-common
|
||||
mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc
|
||||
flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
|
||||
e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
|
||||
bsdmainutils cron vesta vesta-nginx vesta-php expect vim-common
|
||||
vesta-ioncube vesta-softaculous"
|
||||
# Defining software pack for all distros
|
||||
software="apache2 apache2.2-common apache2-suexec-custom apache2-utils
|
||||
apparmor-utils awstats bc bind9 bsdmainutils bsdutils clamav-daemon
|
||||
cron curl dnsutils dovecot-imapd dovecot-pop3d e2fslibs e2fsprogs exim4
|
||||
exim4-daemon-heavy expect fail2ban flex ftp git idn imagemagick
|
||||
libapache2-mod-fcgid libapache2-mod-php libapache2-mod-rpaf
|
||||
libapache2-mod-ruid2 lsof mc mysql-client mysql-common mysql-server nginx
|
||||
ntpdate php-cgi php-common php-curl php-fpm phpmyadmin php-mysql
|
||||
phppgadmin php-pgsql postgresql postgresql-contrib proftpd-basic quota
|
||||
roundcube-core roundcube-mysql roundcube-plugins rrdtool rssh spamassassin
|
||||
sudo vesta vesta-ioncube vesta-nginx vesta-php vesta-softaculous
|
||||
vim-common vsftpd webalizer whois zip"
|
||||
|
||||
# Fix for old releases
|
||||
if [[ ${release:0:2} -lt 16 ]]; then
|
||||
software=$(echo "$software" |sed -e "s/php /php5 /")
|
||||
software=$(echo "$software" |sed -e "s/php-/php5-/")
|
||||
software=$(echo "$software" |sed -e "s/mod-php/mod-php5/")
|
||||
fi
|
||||
|
||||
# Defining help function
|
||||
|
@ -516,7 +495,7 @@ cp -r /etc/bind/* $vst_backups/bind > /dev/null 2>&1
|
|||
service vsftpd stop > /dev/null 2>&1
|
||||
cp /etc/vsftpd.conf $vst_backups/vsftpd > /dev/null 2>&1
|
||||
|
||||
# Backing up ProFTPD configuration
|
||||
# Backup ProFTPD configuration
|
||||
service proftpd stop > /dev/null 2>&1
|
||||
cp /etc/proftpd.conf $vst_backups/proftpd > /dev/null 2>&1
|
||||
|
||||
|
@ -644,18 +623,18 @@ fi
|
|||
# Install packages #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Update system packages
|
||||
# Updating system
|
||||
apt-get update
|
||||
|
||||
# Disable daemon autostart /usr/share/doc/sysv-rc/README.policy-rc.d.gz
|
||||
echo -e '#!/bin/sh \nexit 101' > /usr/sbin/policy-rc.d
|
||||
chmod a+x /usr/sbin/policy-rc.d
|
||||
# Disabling daemon autostart /usr/share/doc/sysv-rc/README.policy-rc.d.gz
|
||||
#echo -e '#!/bin/sh \nexit 101' > /usr/sbin/policy-rc.d
|
||||
#chmod a+x /usr/sbin/policy-rc.d
|
||||
|
||||
# Install apt packages
|
||||
# Installing apt packages
|
||||
apt-get -y install $software
|
||||
check_result $? "apt-get install failed"
|
||||
|
||||
# Restore policy
|
||||
# Restoring policy
|
||||
rm -f /usr/sbin/policy-rc.d
|
||||
|
||||
|
||||
|
@ -663,26 +642,28 @@ rm -f /usr/sbin/policy-rc.d
|
|||
# Configure system #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Enable SSH password auth
|
||||
# Enabling SSH password auth
|
||||
sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
|
||||
service ssh restart
|
||||
|
||||
# Disable AWStats cron
|
||||
# Disabling AWStats cron
|
||||
rm -f /etc/cron.d/awstats
|
||||
|
||||
# Set directory color
|
||||
echo 'LS_COLORS="$LS_COLORS:di=00;33"' >> /etc/profile
|
||||
|
||||
# Register /usr/sbin/nologin
|
||||
echo "/usr/sbin/nologin" >> /etc/shells
|
||||
# Registering /usr/sbin/nologin
|
||||
if [ -z "$(grep nologin /etc/shells)" ]; then
|
||||
echo "/usr/sbin/nologin" >> /etc/shells
|
||||
fi
|
||||
|
||||
# NTP Sync
|
||||
# Configuring NTP
|
||||
echo '#!/bin/sh' > /etc/cron.daily/ntpdate
|
||||
echo "$(which ntpdate) -s ntp.ubuntu.com" >> /etc/cron.daily/ntpdate
|
||||
chmod 775 /etc/cron.daily/ntpdate
|
||||
ntpdate -s ntp.ubuntu.com
|
||||
|
||||
# Setup rssh
|
||||
# Adding rssh
|
||||
if [ -z "$(grep /usr/bin/rssh /etc/shells)" ]; then
|
||||
echo /usr/bin/rssh >> /etc/shells
|
||||
fi
|
||||
|
@ -725,7 +706,6 @@ chmod -R 750 $VESTA/data/queue
|
|||
chmod 660 $VESTA/log/*
|
||||
rm -f /var/log/vesta
|
||||
ln -s $VESTA/log /var/log/vesta
|
||||
chown admin:admin $VESTA/data/sessions
|
||||
chmod 770 $VESTA/data/sessions
|
||||
|
||||
# Generating Vesta configuration
|
||||
|
@ -943,7 +923,7 @@ done
|
|||
|
||||
if [ "$vsftpd" = 'yes' ]; then
|
||||
cp -f $vestacp/vsftpd/vsftpd.conf /etc/
|
||||
touch /var/log//vsftpd.log
|
||||
touch /var/log/vsftpd.log
|
||||
chown root:adm /var/log/vsftpd.log
|
||||
chmod 640 /var/log/vsftpd.log
|
||||
touch /var/log/xferlog
|
||||
|
@ -1267,7 +1247,6 @@ fi
|
|||
|
||||
# Adding default domain
|
||||
$VESTA/bin/v-add-domain admin $servername
|
||||
codename="$codename:$(echo $vpass:$servername | base64)"
|
||||
|
||||
# Adding cron jobs
|
||||
command="sudo $VESTA/bin/v-update-sys-queue disk"
|
||||
|
@ -1320,7 +1299,7 @@ $VESTA/bin/v-add-cron-vesta-autoupdate
|
|||
wget vestacp.com/notify/?$codename -O /dev/null -q
|
||||
|
||||
# Comparing hostname and IP
|
||||
host_ip=$(host $servername| head -n 1 | awk '{print $NF}')
|
||||
host_ip=$(host $servername| head -n 1 |awk '{print $NF}')
|
||||
if [ "$host_ip" = "$ip" ]; then
|
||||
ip="$servername"
|
||||
fi
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
# CentOS 5, 6, 7
|
||||
# Debian 7, 8
|
||||
# Ubuntu 12.04 - 18.04
|
||||
# Amazon Linux 2017
|
||||
#
|
||||
|
||||
# Am I root?
|
||||
|
@ -45,11 +46,6 @@ case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
|
|||
*) type="rhel" ;;
|
||||
esac
|
||||
|
||||
# Fallback to Ubuntu
|
||||
if [ ! -e "/etc/redhat-release" ]; then
|
||||
type='ubuntu'
|
||||
fi
|
||||
|
||||
# Check wget
|
||||
if [ -e '/usr/bin/wget' ]; then
|
||||
wget http://vestacp.com/pub/vst-install-$type.sh -O vst-install-$type.sh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue