Subversion Repositories ALCASAR

Rev

Rev 2603 | Rev 2651 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2603 Rev 2630
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-conf.sh 2603 2018-08-20 00:05:21Z tom.houdayer $
2
# $Id: alcasar-conf.sh 2630 2018-09-09 19:41:54Z rexy $
3
 
3
 
4
# alcasar-conf.sh
4
# alcasar-conf.sh
5
# by REXY
5
# by REXY
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 156... Line 156...
156
			/usr/sbin/urpme --auto --auto-orphans
156
			/usr/sbin/urpme --auto --auto-orphans
157
			rm -rf /etc/httpd/ /var/log/httpd/ /var/dansguardian/ /etc/dansguardian/
157
			rm -rf /etc/httpd/ /var/log/httpd/ /var/dansguardian/ /etc/dansguardian/
158
	## lighttpd need a .pem certificate (aggregation with private key & server crt)
158
	## lighttpd need a .pem certificate (aggregation with private key & server crt)
159
			(cat $DIR_UPDATE/alcasar.key; echo; cat $DIR_UPDATE/alcasar.crt) > $DIR_UPDATE/alcasar.pem
159
			(cat $DIR_UPDATE/alcasar.key; echo; cat $DIR_UPDATE/alcasar.crt) > $DIR_UPDATE/alcasar.pem
160
		fi
160
		fi
161
## since v3.3.1:
161
##  From 3.3.0  ##
-
 
162
		if [ $MAJ_PREVIOUS_VERSION == "3" ] && [ $MIN_PREVIOUS_VERSION == "3" ] && [ $UPD_PREVIOUS_VERSION == "0" ]
-
 
163
		then
162
	# add "SMS=off" in conf file
164
	# add "SMS=off" in conf file
163
		if [ $(grep -c '^SMS=' $CONF_FILE) -eq 0 ]; then
165
			if [ $(grep -c '^SMS=' $DIR_UPDATE/etc/alcasar.conf) -eq 0 ]; then
164
			if [ $(grep -c '^\$service_SMS_status = true;' /var/www/html/autoregistrationinfo.php) -ne 0 ]; then
-
 
165
				echo "SMS=on" >> $CONF_FILE
166
					echo "SMS=off" >> $DIR_UPDATE/etc/alcasar.conf
166
			else
167
			fi
-
 
168
			if [ $(grep -c '^SMS_NUM=' $DIR_UPDATE/etc/alcasar.conf) -eq 0 ]; then
167
				echo "SMS=off" >> $CONF_FILE
169
					echo "SMS_NUM=0" >> $DIR_UPDATE/etc/alcasar.conf
168
			fi
170
			fi
169
		fi
-
 
170
		if [ $(grep -c '^SMS_NUM=' $CONF_FILE) -eq 0 ]; then
-
 
171
			num=$(grep "^\\\$current_num\s\?=\s\?'.\+';\$" /var/www/html/autoregistrationinfo.php | sed "s@^\\\$current_num\s\?=\s\?'\(.\+\)';\$@\1@")
-
 
172
			[ "$num" == 'XXXXXXXXXX' ] && num=''
-
 
173
			echo "SMS_NUM=$num" >> $CONF_FILE
-
 
174
		fi
171
		fi
175
######################   End of modifications between versions  #######################
172
######################   End of modifications between versions  #######################
176
# Retrieve the logo
173
# Retrieve the logo
177
		[ -e $DIR_UPDATE/organisme.png ] && cp -f $DIR_UPDATE/organisme.png $DIR_WEB/images/
174
		[ -e $DIR_UPDATE/organisme.png ] && cp -f $DIR_UPDATE/organisme.png $DIR_WEB/images/
178
		chown apache:apache $DIR_WEB/images/organisme.png $DIR_WEB/intercept.php
175
		chown apache:apache $DIR_WEB/images/organisme.png $DIR_WEB/intercept.php