Alternc  latest
Alternc logiel libre pour l'hébergement
3.0.3~b.sh
Go to the documentation of this file.
1 #!/bin/bash
2 # Upgrading script to AlternC 3.0.3
3 
4 CONFIG_FILE="/usr/lib/alternc/functions.sh"
5 PATH=/sbin:/bin:/usr/sbin:/usr/bin
6 
7 umask 022
8 
9 if [ ! -r "$CONFIG_FILE" ]; then
10  echo "Can't access $CONFIG_FILE."
11  exit 1
12 fi
13 
14 if [ `id -u` -ne 0 ]; then
15  echo "3.0.3~b.sh must be launched as root"
16  exit 1
17 fi
18 
19 . "$CONFIG_FILE"
20 
21 
22 ## This part create TMP dir if don't exist
23 function create_tmp_dir() {
24  read LOGIN || true
25  while [ "$LOGIN" ]; do
26  echo "Check tmp directory for $LOGIN"
27  REP="$(get_html_path_by_name $LOGIN )/tmp/"
28  [[ "$REP" != "/tmp/" ]] && ( test -d "$REP" || mkdir $REP )
29  read LOGIN || true
30  done
31 }
32 
33 mysql_query "select login from membres order by login;" | create_tmp_dir