From a945fef25c464c37c873c03f263ad9c7eda60307 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Thu, 13 Jun 2013 12:12:45 +0000 Subject: [PATCH] Fix #1500 --- .gitattributes | 1 + install/upgrades/3.0.3~b.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 install/upgrades/3.0.3~b.sh diff --git a/.gitattributes b/.gitattributes index c0d37874..7af38c64 100644 --- a/.gitattributes +++ b/.gitattributes @@ -548,6 +548,7 @@ install/upgrades/3.0.0~3.php -text install/upgrades/3.0.0~4.sh -text install/upgrades/3.0.1.php -text install/upgrades/3.0.3~a.sql -text +install/upgrades/3.0.3~b.sh -text install/upgrades/README -text lang/.svnignore -text lang/README -text diff --git a/install/upgrades/3.0.3~b.sh b/install/upgrades/3.0.3~b.sh new file mode 100755 index 00000000..2fcbb192 --- /dev/null +++ b/install/upgrades/3.0.3~b.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Upgrading script to AlternC 3.0.3 + +CONFIG_FILE="/usr/lib/alternc/functions.sh" +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +umask 022 + +if [ ! -r "$CONFIG_FILE" ]; then + echo "Can't access $CONFIG_FILE." + exit 1 +fi + +if [ `id -u` -ne 0 ]; then + echo "fixperms.sh must be launched as root" + exit 1 +fi + +. "$CONFIG_FILE" + + +## This part create TMP dir if don't exist +function create_tmp_dir() { + read LOGIN || true + while [ "$LOGIN" ]; do + echo "Check tmp directory for $LOGIN" + REP="$(get_html_path_by_name $LOGIN )/tmp/" + [[ "$REP" != "/tmp/" ]] && ( test -d "$REP" || mkdir $REP ) + read LOGIN || true + done +} + +mysql_query "select login from membres order by login;" | create_tmp_dir