ShellCheck: Fix printf '\n' character
This commit is contained in:
		
							parent
							
								
									5a7c3ff5a2
								
							
						
					
					
						commit
						250c8103cf
					
				|  | @ -64,7 +64,7 @@ function GetMyHostKey() { | |||
| 	if [ ! -f "${hostkey}" ]; then | ||||
| 		hostkey="/etc/ssh/ssh_host_rsa_key.pub" | ||||
| 		if [ ! -f "${hostkey}" ]; then | ||||
| 			printf '\e[1;31m%-6s\e[m\n' "ERREUR : Impossible de trouver la clef ssh publique ce cette machine, SSH est-il bien installé?\n Installation annulée." | ||||
| 			printf '\e[1;31m%-6s\e[m\n' "ERREUR : Impossible de trouver la clef ssh publique ce cette machine, SSH est-il bien installé?\\n Installation annulée." | ||||
| 			return "$ERROR" | ||||
| 		fi | ||||
| 	fi | ||||
|  | @ -151,7 +151,7 @@ function AllowBackuppcSudo() { | |||
| 	if [ -f /etc/sudoers ]; then | ||||
| 		local sudoersDir=$(grep "^#includedir " /etc/sudoers | cut -d" " -f2) | ||||
| 		if [ ! "${sudoersDir}" == '' ]; then | ||||
| 			printf "%b\n" "Configuration de sudo pour BackupPC." | ||||
| 			printf '%b\n' "Configuration de sudo pour BackupPC." | ||||
| 		else | ||||
| 				echo "#includedir /etc/sudoers.d" >> /etc/sudoers | ||||
| [[ "${DEBUG}" == "0" ]] && 				printf '\e[1;33m%-6s\e[m\n' "DEBUG : Ajout de ${sudoersDir} dans le fichier sudoers." | ||||
|  | @ -159,7 +159,7 @@ function AllowBackuppcSudo() { | |||
| 	elif [ -f /private/etc/sudoers ]; then | ||||
| 		local sudoersDir=$(grep "^#includedir " /private/etc/sudoers | cut -d" " -f2) | ||||
| 		if [ ! "${sudoersDir}" == '' ]; then | ||||
| 			printf "%b\n" "Configuration de sudo pour BackupPC." | ||||
| 			printf '%b\n' "Configuration de sudo pour BackupPC." | ||||
| 		else | ||||
| 			echo "#includedir /private/etc/sudoers.d" >> /private/etc/sudoers | ||||
| [[ "${DEBUG}" == "0" ]] && 			printf '\e[1;33m%-6s\e[m\n' "DEBUG : Ajout de ${sudoersDir} dans le fichier sudoers." | ||||
|  | @ -191,7 +191,7 @@ fi | |||
| #### NOM DU COMPTE À SAUVEGARDER #### | ||||
| [[ "${DEBUG}" == "0" ]] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Partie - Nom du compte à sauvegarder" | ||||
| default_user=$(GetDefaultUser) | ||||
| printf "%b\n" "Liste des comptes détectés sur cette machine : $(ListUsers)" | ||||
| printf '%b\n' "Liste des comptes détectés sur cette machine : $(ListUsers)" | ||||
| printf '\e[1;34m%-6s\e[m' "Login de l’utilisateur dont les données sont à sauvegarder ? [${default_user}] : " | ||||
| read input_login | ||||
| if [[ ${input_login} != "" ]]; then | ||||
|  | @ -217,7 +217,7 @@ default_dir=$(eval echo ~"${usr}") | |||
| if [ ! -d "${default_dir}" ]; then | ||||
| 	default_dir="" | ||||
| fi | ||||
| printf "%b\n" "Par défaut, le dossier sauvegardé est le home de l’utilisateur. Il est possible d’en ajouter un supplémentaire ensuite." | ||||
| printf '%b\n' "Par défaut, le dossier sauvegardé est le home de l’utilisateur. Il est possible d’en ajouter un supplémentaire ensuite." | ||||
| printf '\e[1;34m%-6s\e[m' "Dossier à sauvegarder ? [${default_dir}] : " | ||||
| read input_dir | ||||
| if [[ "${input_dir}" == "" ]]; then | ||||
|  | @ -240,8 +240,8 @@ read input_dir2 | |||
| if [[ "${input_dir2}" != "" ]]; then | ||||
| 	#### DOSSIER SUPPLÉMENTAIRE INTROUVABLE, ANNULATION DE CELUI-CI #### | ||||
| 	if [ ! -d "${input_dir2}" ]; then | ||||
| 		printf "\n" | ||||
| 		printf "%b\n" "Dossier supplémentaire introuvable, non ajouté." | ||||
| 		printf '\n' | ||||
| 		printf '%b\n' "Dossier supplémentaire introuvable, non ajouté." | ||||
| 	else | ||||
| 		directories="'${dir1}','${input_dir2}'" | ||||
| 	fi | ||||
|  | @ -313,8 +313,8 @@ chown -R backuppc "${homebackuppc}"/.ssh/ | |||
| 
 | ||||
| #### END #### | ||||
| [[ "${DEBUG}" == "0" ]] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Partie - FIN" | ||||
| printf "%b\n" "Configuration du poste terminée." | ||||
| printf '%b\n' "Configuration du poste terminée." | ||||
| printf '\e[1;31m%-6s\e[m\n' "Envoyez bien votre fichier de configuration situé dans votre répertoire personnel (${dir1}/${filepl}) à Jérémy GARDAIS (jeremy.gardai@univ-rennes1.fr)." | ||||
| printf "%b\n" "Vous pourrez affiner la configuration de votre sauvegarde depuis https://backuppc.ipr.univ-rennes1.fr" | ||||
| printf '%b\n' "Vous pourrez affiner la configuration de votre sauvegarde depuis https://backuppc.ipr.univ-rennes1.fr" | ||||
| 
 | ||||
| exit 0 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue