From c6611ee0fc88487541f1aa90528a0b9cdcb6a703 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sat, 02 Jan 2016 09:04:27 -0500
Subject: [PATCH] Merge branch 'master' into 'master'

---
 server/plugins-available/mail_plugin_dkim.inc.php |    2 +-
 server/scripts/update_from_dev.sh                 |   20 ++++++++++++++++----
 interface/lib/classes/validate_openvz.inc.php     |    2 +-
 interface/lib/classes/validate_dkim.inc.php       |    2 +-
 server/scripts/update_from_tgz.sh                 |   30 +++++++++++++++++-------------
 5 files changed, 36 insertions(+), 20 deletions(-)

diff --git a/interface/lib/classes/validate_dkim.inc.php b/interface/lib/classes/validate_dkim.inc.php
index 5d7fb8f..443fe76 100644
--- a/interface/lib/classes/validate_dkim.inc.php
+++ b/interface/lib/classes/validate_dkim.inc.php
@@ -29,7 +29,7 @@
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
  @author Florian Schaal, info@schaal-24.de
- @copyrighth Florian Schaal, info@schaal-24.de
+ @copyright Florian Schaal, info@schaal-24.de
  */
 
 
diff --git a/interface/lib/classes/validate_openvz.inc.php b/interface/lib/classes/validate_openvz.inc.php
index 75e41fe..4aa1a70 100644
--- a/interface/lib/classes/validate_openvz.inc.php
+++ b/interface/lib/classes/validate_openvz.inc.php
@@ -28,7 +28,7 @@
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
  @author Florian Schaal, info@schaal-24.de
- @copyrighth Florian Schaal, info@schaal-24.de
+ @copyright Florian Schaal, info@schaal-24.de
  */
 
 class validate_openvz {
diff --git a/server/plugins-available/mail_plugin_dkim.inc.php b/server/plugins-available/mail_plugin_dkim.inc.php
index 0e0208a..25f1871 100755
--- a/server/plugins-available/mail_plugin_dkim.inc.php
+++ b/server/plugins-available/mail_plugin_dkim.inc.php
@@ -29,7 +29,7 @@
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
  @author Florian Schaal, info@schaal-24.de
- @copyrighth Florian Schaal, info@schaal-24.de
+ @copyright Florian Schaal, info@schaal-24.de
  */
 
 
diff --git a/server/scripts/update_from_dev.sh b/server/scripts/update_from_dev.sh
old mode 100644
new mode 100755
index 98adb17..fe2f6ef
--- a/server/scripts/update_from_dev.sh
+++ b/server/scripts/update_from_dev.sh
@@ -1,17 +1,29 @@
 #!/bin/bash
 
-cd /tmp
-rm -f ispconfig3-dev.tar.gz
+{
+    umask 0077 \
+    && tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
+    && test -d "${tmpdir}" \
+    && cd "${tmpdir}"
+} || {
+    echo 'mktemp failed'
+    exit 1
+}
+
 wget -O ispconfig3-dev.tar.gz "http://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=master"
-rm -rf ispconfig3-master*
 tar xzf ispconfig3-dev.tar.gz
+
+echo -n "Latest git version:  "
+ls -1d ispconfig3-master*
 cd ispconfig3-master*/install
+
 php -q \
     -d disable_classes= \
     -d disable_functions= \
     -d open_basedir= \
     update.php
+
 cd /tmp
-rm -rf /tmp/ispconfig3-master* /tmp/ispconfig3-dev.tar.gz
+rm -rf "${tmpdir}"
 
 exit 0
diff --git a/server/scripts/update_from_tgz.sh b/server/scripts/update_from_tgz.sh
index 7d59e40..9dcf52d 100644
--- a/server/scripts/update_from_tgz.sh
+++ b/server/scripts/update_from_tgz.sh
@@ -1,11 +1,14 @@
 #!/bin/bash
 
-cd /tmp
-
-if [ -f ISPConfig-3-stable.tar.gz ]
-then
-rm -f ISPConfig-3-stable.tar.gz
-fi
+{
+    umask 0077 \
+    && tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
+    && test -d "${tmpdir}" \
+    && cd "${tmpdir}"
+} || {
+    echo 'mktemp failed'
+    exit 1
+}
 
 wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
 if [ -f ISPConfig-3-stable.tar.gz ]
@@ -13,14 +16,15 @@
 	tar xvfz ISPConfig-3-stable.tar.gz
 	cd ispconfig3_install/install/
 	php -q \
-    -d disable_classes= \
-    -d disable_functions= \
-    -d open_basedir= \
-    update.php
-	rm -rf /tmp/ispconfig3_install/install
-	rm -f ISPConfig-3-stable.tar.gz
+        -d disable_classes= \
+        -d disable_functions= \
+        -d open_basedir= \
+        update.php
+    cd /tmp
+    rm -rf "${tmpdir}"
 else
 	echo "Unable to download the update."
+    exit 1
 fi
 
-exit 0
\ No newline at end of file
+exit 0

--
Gitblit v1.9.1