99# Ubuntu 14.04, 16.04, 18.04
1010#
1111
12+ # Detect Codename
13+ if [ " $type " = " debian" ]; then
14+ codename=" $( cat /etc/os-release | grep VERSION= | cut -f 2 -d \( | cut -f 1 -d \) ) "
15+ release=$( cat /etc/debian_version| grep -o [0-9]| head -n1)
16+ VERSION=' debian'
17+ fi
18+
19+ if [ " $type " = " ubuntu" ]; then
20+ codename=" $( lsb_release -s -c) "
21+ release=" $( lsb_release -s -r) "
22+ VERSION=' ubuntu'
23+ fi
24+
1225HESTIA=" /usr/local/hestia"
1326RHOST=' apt.hestiacp.com'
1427os=$( head -n1 /etc/issue | cut -f 1 -d ' ' )
1528apt=" /etc/apt/sources.list.d"
29+ hestiacp=" $HESTIA /install/$VERSION /$release "
1630
1731# Am I root?
1832if [ " x$( id -u) " != ' x0' ]; then
@@ -33,15 +47,6 @@ if [ "$type" = "NoSupport" ]; then
3347 exit 1;
3448fi
3549
36- # Detect Codename
37- if [ " $type " = " debian" ]; then
38- codename=" $( cat /etc/os-release | grep VERSION= | cut -f 2 -d \( | cut -f 1 -d \) ) "
39- fi
40-
41- if [ " $type " = " ubuntu" ]; then
42- codename=" $( lsb_release -s -c) "
43- fi
44-
4550# Check if Vesta is installed
4651if [ -f /usr/local/vesta/conf/vesta.conf ]; then
4752 source /usr/local/vesta/conf/vesta.conf
@@ -123,6 +128,28 @@ mv /etc/profile.d/vesta.sh /etc/profile.d/hestia.sh
123128mv /usr/local/vesta $HESTIA
124129mv $HESTIA /conf/vesta.conf $HESTIA /conf/hestia.conf
125130
131+ # Add changed configuration files
132+ echo " export HESTIA='$HESTIA '" >> /etc/profile.d/hestia.sh
133+
134+ rm /etc/sudoers.d/admin
135+ cp -f $hestiacp /sudo/admin /etc/sudoers.d/
136+ chmod 440 /etc/sudoers.d/admin
137+
138+ sed -i ' s/vesta/hestia/g' /root/.bash_profile
139+ sed -i ' s/VESTA/HESTIA/g' /etc/profile.d/hestia.sh
140+ sed -i ' s/vesta/hestia/g' /etc/profile.d/hestia.sh
141+
142+ cp -rf $hestiacp /firewall $HESTIA /data/
143+ rm -f /var/log/vesta
144+
145+ rm /usr/share/roundcube/plugins/password/drivers/vesta.php
146+ cp -f $hestiacp /roundcube/hestia.php \
147+ /usr/share/roundcube/plugins/password/drivers/
148+ sed -i ' s/vesta/hestia/g' /etc/roundcube/config.inc.php
149+
150+ rm /etc/logrotate.d/vesta
151+ cp -f $hestiacp /logrotate/vesta /etc/logrotate.d/hestia
152+
126153# Install hestia packages
127154echo " Update System Repository and install HestiaCP Packages..."
128155apt-get -qq update
@@ -136,5 +163,8 @@ systemctl restart hestia
136163ln -s $HESTIA /usr/local/vesta
137164ln -s $HESTIA /conf/hestia.conf /usr/local/vesta/conf/vesta.conf
138165
166+ # Update firewall rules
167+ $HESTIA /bin/v-update-firewall
168+
139169echo " Migration is finished, you're running now HestiaCP instead VestaCP."
140170echo " Please contact us if you've any troubles using our forum: https://forum.hestiacp.com"
0 commit comments