[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 #!/bin/bash 2 3 # Script de création du dossier au nom du parc dans /home/template 4 # Stéphane Boireau - 06/04/2005 5 #Avec le précieux coup de main de 'out' pour PERL. 6 7 if [ ! -z "$1" ]; then 8 #verif=$(echo "$1" | sed -e "s/[A-Za-z0-9_.]//g" | wc -c | sed -e "s/ //g") 9 verif=$((`echo "$1" | tr -d "[A-Za-z0-9_.]" | wc -c`)) 10 if [ "$verif" = "1" ]; then 11 if [ ! -e "/home/templates/$1" ]; then 12 13 if [ -z "$2" ]; then 14 type="parc" 15 else 16 type="groupe" 17 fi 18 19 ladate=$(date +%Y%m%d%H%M%S) 20 21 mkdir -p /home/templates/$1 22 mkdir -p /home/templates/$1/Bureau 23 mkdir -p /home/templates/$1/Demarrer/Programmes 24 echo -e "rem Script de login du $type $1" > /home/templates/$1/logon.bat.$ladate} 25 echo -e "rem Partie commune a tous les clients." >> /home/templates/$1/logon.bat.$ladate} 26 cat /home/templates/$1/logon.bat.$ladate} | perl -pe 's/\n/\r\n/' > /home/templates/$1/logon.bat 27 rm -f /home/templates/$1/logon.bat.$ladate} 28 29 echo -e "rem Script de login du $type $1" > /home/templates/$1/logon_Win95.bat.$ladate} 30 echo -e "rem Partie specifique aux clients win9x" >> /home/templates/$1/logon_Win95.bat.$ladate} 31 cat /home/templates/$1/logon_Win95.bat.$ladate} | perl -pe 's/\n/\r\n/' > /home/templates/$1/logon_Win95.bat 32 rm -f /home/templates/$1/logon_Win95.bat.$ladate} 33 #NOTE: Cela fonctionne aussi avec: 34 #cat /home/templates/$1/logon_Win95.bat | sed 's/$/µ/g' | tr 'µ' '\r' > /home/templates/$1/logon_Win95.bat 35 #vim -c "set ff=dos" -c ":wq" /home/templates/$1/logon_Win95.bat 36 37 echo "rem Script de login du $type $1" > /home/templates/$1/logon_Win2K.bat.$ladate} 38 echo "rem Partie specifique aux clients win2k" >> /home/templates/$1/logon_Win2K.bat.$ladate} 39 cat /home/templates/$1/logon_Win2K.bat.$ladate} | perl -pe 's/\n/\r\n/' > /home/templates/$1/logon_Win2K.bat 40 rm -f /home/templates/$1/logon_Win2K.bat.$ladate} 41 42 echo "rem Script de login du $type $1" > /home/templates/$1/logon_WinXP.bat.$ladate} 43 echo "rem Partie specifique aux clients winxp" >> /home/templates/$1/logon_WinXP.bat.$ladate} 44 cat /home/templates/$1/logon_WinXP.bat.$ladate} | perl -pe 's/\n/\r\n/' > /home/templates/$1/logon_WinXP.bat 45 rm -f /home/templates/$1/logon_WinXP.bat.$ladate} 46 fi 47 fi 48 fi
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Mar 17 22:47:18 2015 | Cross-referenced by PHPXref 0.7.1 |