ajout ScriptDokuwikiv2.sh et dau.sh
This commit is contained in:
		
							
								
								
									
										39
									
								
								ap23/script/ScriptDokuWikiv2.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										39
									
								
								ap23/script/ScriptDokuWikiv2.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
set -e
 | 
			
		||||
 | 
			
		||||
#ip dans la variable $3
 | 
			
		||||
ip=$(ip -br a|grep UP|awk '{print $3}'|cut -f1 -d'/')
 | 
			
		||||
 | 
			
		||||
#dependances
 | 
			
		||||
apt install apache2 php php-mbstring php-xml php-gd -y
 | 
			
		||||
 | 
			
		||||
#telechargement dokuwiki et deplacement dans /var/www/html/dokuwiki et suppression archive plus utile
 | 
			
		||||
cd /tmp
 | 
			
		||||
wget http://depl.sio.lan/store/dokuwiki-stable.tgz
 | 
			
		||||
tar -xzvf dokuwiki-stable.tgz
 | 
			
		||||
rm dokuwiki-stable.tgz
 | 
			
		||||
 | 
			
		||||
#check si bonne version de dokuwiki extraite
 | 
			
		||||
if [ ! -d dokuwiki-2020-07-29 ] ; then
 | 
			
		||||
	echo "Erreur de version dokuwiki : version attendue : dokuwiki-2020-07-29"
 | 
			
		||||
	exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
#deplacement dans le repertoire de base apache2/dokuwiki
 | 
			
		||||
mv dokuwiki-2020-07-29 dokuwiki
 | 
			
		||||
mv dokuwiki /var/www/html
 | 
			
		||||
cd /var/www/html
 | 
			
		||||
 | 
			
		||||
#suppresion index.html pas necessaire si present
 | 
			
		||||
if [ -d index.html ] ; then
 | 
			
		||||
	rm index.html
 | 
			
		||||
fi
 | 
			
		||||
cd /var/www/html/dokuwiki
 | 
			
		||||
chown -R root:root .
 | 
			
		||||
chown -R www-data:www-data data lib conf
 | 
			
		||||
 | 
			
		||||
#nettoyage affichage et resultat
 | 
			
		||||
clear
 | 
			
		||||
echo "Installation de dokuwiki terminee."
 | 
			
		||||
echo "Connectez-vous avec un navigateur à l'adresse http://$ip/dokuwiki/install.php"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								ap23/script/dau.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										12
									
								
								ap23/script/dau.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
#check si il y a un argument et exit 1 si y'a pas
 | 
			
		||||
if [ ! $1 ] ; then
 | 
			
		||||
	echo "Usage : $0 user >> /var/www/html/dokuwiki/conf/users.ayth.php"
 | 
			
		||||
	exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# chiffremment du mot de passe $1 avec bcrypt
 | 
			
		||||
hashpass=$(htpasswd -bnBC 10 "" $1|tr -d '/d')
 | 
			
		||||
bon=$1$hashpass:$1:$1@localhost:$1,user
 | 
			
		||||
echo $bon
 | 
			
		||||
		Reference in New Issue
	
	Block a user