소스 검색

adedd vim-common + improved formatting: 79 characters per line

Serghey Rodin 8 년 전
부모
커밋
651ba4c1aa
1개의 변경된 파일34개의 추가작업 그리고 26개의 파일을 삭제
  1. 34 26
      install/vst-install-debian.sh

+ 34 - 26
install/vst-install-debian.sh

@@ -29,7 +29,8 @@ if [ "$release" -eq 8 ]; then
         mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc
         mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc
         flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
         flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
         e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
         e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
-        bsdmainutils cron vesta vesta-nginx vesta-php expect libmail-dkim-perl unrar-free"
+        bsdmainutils cron vesta vesta-nginx vesta-php expect libmail-dkim-perl
+        unrar-free vim-common"
 else
 else
     software="nginx apache2 apache2-utils apache2.2-common
     software="nginx apache2 apache2-utils apache2.2-common
         apache2-suexec-custom libapache2-mod-ruid2
         apache2-suexec-custom libapache2-mod-ruid2
@@ -41,7 +42,8 @@ else
         mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc
         mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc
         flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
         flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
         e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
         e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
-        bsdmainutils cron vesta vesta-nginx vesta-php expect unrar-free"
+        bsdmainutils cron vesta vesta-nginx vesta-php expect unrar-free
+        vim-common"
 fi
 fi
 
 
 # Defining help function
 # Defining help function
@@ -967,11 +969,12 @@ fi
 if [ "$postgresql" = 'yes' ]; then
 if [ "$postgresql" = 'yes' ]; then
     wget $vestacp/postgresql/pg_hba.conf -O /etc/postgresql/*/main/pg_hba.conf
     wget $vestacp/postgresql/pg_hba.conf -O /etc/postgresql/*/main/pg_hba.conf
     service postgresql restart
     service postgresql restart
-    sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$vpass'" 2>/dev/null
+    sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$vpass'"
 
 
     # Configuring phpPgAdmin
     # Configuring phpPgAdmin
     if [ "$apache" = 'yes' ]; then
     if [ "$apache" = 'yes' ]; then
-        wget $vestacp/pga/phppgadmin.conf -O /etc/apache2/conf.d/phppgadmin.conf
+        wget $vestacp/pga/phppgadmin.conf \
+            -O /etc/apache2/conf.d/phppgadmin.conf
     fi
     fi
     wget $vestacp/pga/config.inc.php -O /etc/phppgadmin/config.inc.php
     wget $vestacp/pga/config.inc.php -O /etc/phppgadmin/config.inc.php
 fi
 fi
@@ -1065,13 +1068,13 @@ if [ "$clamd" = 'yes' ]; then
         mkdir /var/run/clamav
         mkdir /var/run/clamav
     fi
     fi
     chown -R clamav:clamav /var/run/clamav
     chown -R clamav:clamav /var/run/clamav
-    if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then
-        file="/lib/systemd/system/clamav-daemon.service"
-        if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then
-            sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/bin\/chown -R clamav:clamav \/var\/run\/clamav/g" $file
-        fi
+    if [ -e "/lib/systemd/system/clamav-daemon.service" ]; then
+        exec_pre1='ExecStartPre=/bin/mkdir -p /var/run/clamav'
+        exec_pre2='ExecStartPre=/bin/chown -R clamav:clamav /var/run/clamav'
+        sed -i "s|\[Service\]/|[Service]\n$exec_pre1\n$exec_pre2|g" \
+            /lib/systemd/system/clamav-daemon.service
+        systemctl daemon-reload
     fi
     fi
-
     service clamav-daemon start
     service clamav-daemon start
     check_result $? "clamav-daeom start failed"
     check_result $? "clamav-daeom start failed"
 fi
 fi
@@ -1086,7 +1089,8 @@ if [ "$spamd" = 'yes' ]; then
     sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
     sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
     service spamassassin start
     service spamassassin start
     check_result $? "spamassassin start failed"
     check_result $? "spamassassin start failed"
-    if [[ $(systemctl list-unit-files | grep spamassassin) =~ "disabled" ]]; then
+    unit_files="$(systemctl list-unit-files |grep spamassassin)"
+    if [[ "$unit_files" =~ "disabled" ]]; then
         systemctl enable spamassassin
         systemctl enable spamassassin
     fi
     fi
 fi
 fi
@@ -1113,9 +1117,11 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
         /etc/roundcube/plugins/password/config.inc.php
         /etc/roundcube/plugins/password/config.inc.php
     r="$(gen_pass)"
     r="$(gen_pass)"
     mysql -e "CREATE DATABASE roundcube"
     mysql -e "CREATE DATABASE roundcube"
-    mysql -e "GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY '$r'"
+    mysql -e "GRANT ALL ON roundcube.* 
+        TO roundcube@localhost IDENTIFIED BY '$r'"
     sed -i "s/%password%/$r/g" /etc/roundcube/db.inc.php
     sed -i "s/%password%/$r/g" /etc/roundcube/db.inc.php
-    sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php
+    sed -i "s/localhost/$servername/g" \
+        /etc/roundcube/plugins/password/config.inc.php
     mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
     mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
     chmod a+r /etc/roundcube/main.inc.php
     chmod a+r /etc/roundcube/main.inc.php
     if [ "$release" -eq 8 ]; then
     if [ "$release" -eq 8 ]; then
@@ -1134,13 +1140,15 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
         if [[ -L "$tinymceFolder" && -d "$tinymceFolder" ]]; then
         if [[ -L "$tinymceFolder" && -d "$tinymceFolder" ]]; then
             if [ -f "$tinymceBadJS" ]; then
             if [ -f "$tinymceBadJS" ]; then
                 wget $tinymceFixArchiveURL -O $tinymceFixArchive
                 wget $tinymceFixArchiveURL -O $tinymceFixArchive
-                if [[ -f "$tinymceFixArchive" && -s "$tinymceFixArchive" ]]; then
+                if [[ -f "$tinymceFixArchive" && -s "$tinymceFixArchive" ]]
+                then
                     rm $tinymceFolder
                     rm $tinymceFolder
                     tar -xzf $tinymceFixArchive -C $tinymceParentFolder
                     tar -xzf $tinymceFixArchive -C $tinymceParentFolder
                     rm $tinymceFixArchive
                     rm $tinymceFixArchive
                     chown -R root:root $tinymceFolder
                     chown -R root:root $tinymceFolder
                 else
                 else
-                    echo "File roundcube-tinymce.tar.gz is not downloaded, RoundCube tinyMCE fix is not applied"
+                    echo -n "File roundcube-tinymce.tar.gz is not downloaded,"
+                    echo "RoundCube tinyMCE fix is not applied"
                     rm $tinymceFixArchive
                     rm $tinymceFixArchive
                 fi
                 fi
             fi
             fi
@@ -1210,7 +1218,7 @@ $VESTA/bin/v-update-sys-ip
 
 
 # Get main ip
 # Get main ip
 ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
 ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
-copy_of_ip=$ip
+local_ip=$ip
 
 
 # Firewall configuration
 # Firewall configuration
 if [ "$iptables" = 'yes' ]; then
 if [ "$iptables" = 'yes' ]; then
@@ -1227,19 +1235,19 @@ fi
 
 
 # Configuring libapache2-mod-remoteip
 # Configuring libapache2-mod-remoteip
 if [ "$apache" = 'yes' ] && [ "$nginx"  = 'yes' ] ; then
 if [ "$apache" = 'yes' ] && [ "$nginx"  = 'yes' ] ; then
-    copy_of_pub_ip=$pub_ip
-    echo "<IfModule mod_remoteip.c>" > /etc/apache2/mods-available/remoteip.conf
-    echo "  RemoteIPHeader X-Real-IP" >> /etc/apache2/mods-available/remoteip.conf
-    if [ "$copy_of_ip" != "127.0.0.1" ] && [ "$copy_of_pub_ip" != "127.0.0.1" ]; then
-        echo "  RemoteIPInternalProxy 127.0.0.1" >> /etc/apache2/mods-available/remoteip.conf
+    cd /etc/apache2/mods-available
+    echo "<IfModule mod_remoteip.c>" > remoteip.conf
+    echo "  RemoteIPHeader X-Real-IP" >> remoteip.conf
+    if [ "$local_ip" != "127.0.0.1" ] && [ "$pub_ip" != "127.0.0.1" ]; then
+        echo "  RemoteIPInternalProxy 127.0.0.1" >> remoteip.conf
     fi
     fi
-    if [ ! -z "$copy_of_ip" ] && [ "$copy_of_ip" != "$copy_of_pub_ip" ]; then
-        echo "  RemoteIPInternalProxy $copy_of_ip" >> /etc/apache2/mods-available/remoteip.conf
+    if [ ! -z "$local_ip" ] && [ "$local_ip" != "$pub_ip" ]; then
+        echo "  RemoteIPInternalProxy $local_ip" >> remoteip.conf
     fi
     fi
-    if [ ! -z "$copy_of_pub_ip" ]; then
-        echo "  RemoteIPInternalProxy $copy_of_pub_ip" >> /etc/apache2/mods-available/remoteip.conf
+    if [ ! -z "$pub_ip" ]; then
+        echo "  RemoteIPInternalProxy $pub_ip" >> remoteip.conf
     fi
     fi
-    echo "</IfModule>" >> /etc/apache2/mods-available/remoteip.conf
+    echo "</IfModule>" >> remoteip.conf
     sed -i "s/LogFormat \"%h/LogFormat \"%a/g" /etc/apache2/apache2.conf
     sed -i "s/LogFormat \"%h/LogFormat \"%a/g" /etc/apache2/apache2.conf
     a2enmod remoteip
     a2enmod remoteip
     service apache2 restart
     service apache2 restart