From e32e4d2ed21ab9606b55b2cd9cd8360865cacf66 Mon Sep 17 00:00:00 2001 From: ABelliqueux Date: Thu, 3 Nov 2022 12:48:58 +0100 Subject: [PATCH] French l10n of install script --- fr/LC_MESSAGES/fr.po | 258 +++++++++++++++++++++++ fr/LC_MESSAGES/linux_server_deploy.sh.mo | Bin 0 -> 6683 bytes linux_server_deploy.sh | 115 +++++----- 3 files changed, 319 insertions(+), 54 deletions(-) create mode 100644 fr/LC_MESSAGES/fr.po create mode 100644 fr/LC_MESSAGES/linux_server_deploy.sh.mo diff --git a/fr/LC_MESSAGES/fr.po b/fr/LC_MESSAGES/fr.po new file mode 100644 index 0000000..d145e00 --- /dev/null +++ b/fr/LC_MESSAGES/fr.po @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-11-03 11:58+0100\n" +"PO-Revision-Date: 2022-11-03 11:58+0100\n" +"Last-Translator: FULL NAME \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: linux_server_deploy.sh:39 +msgid "" +"Usage: ./pilpil-server.sh path_to_device\n" +"\n" +"This script will setup as much pilpil-clients as needed." +msgstr "" +"Usage: ./pilpil-server.sh chemin_du_périphérique\n" +"\n" +"Ce script aide au déploiement d'instances pilpil." + +#: linux_server_deploy.sh:46 +msgid "!!! Running in dry mode. No modifications will be made.\\n" +msgstr "!!! Exécution en mode simulation. Aucune modification ne sera faite.\\n" + +#: linux_server_deploy.sh:58 +msgid "Please specify an existing device block for your sd-card, e.g: '/dev/sda'." +msgstr "Veuillez spécifier un bloc de périphérique existant pour la carte sd, par ex. : '/dev/sda'" + +#: linux_server_deploy.sh:70 +msgid "Disk image not found, aborting..." +msgstr "Image disque introuvable, annulation..." + +#: linux_server_deploy.sh:75 +msgid "Config directory not found, aborting..." +msgstr "Dossier de configuration introuvable, annulation..." + +#: linux_server_deploy.sh:85 +msgid "Medias directory not found, aborting..." +msgstr "Dossier des médias introuvable, annulation..." + +#: linux_server_deploy.sh:104 +msgid " * Creating hotspot connection in NetworkManager \\n" +msgstr " * Création du point d'accès Wifi dans NetworkManager" + +#: linux_server_deploy.sh:116 +#, sh-format +msgid "" +" * Setting IP range $IP_RANGE/24 in /etc/NetworkManager/system-connections/" +"$SSID.nmconnection ... \\n" +msgstr "" +" * Utilisation de la tranche d'IP $IP_RANGE/24 dans /etc/NetworkManager/system-connections/" +"$SSID.nmconnection ... \\n" + +#: linux_server_deploy.sh:129 +msgid "Number of clients to configure : " +msgstr "Nombre de clients à configurer : " + +#: linux_server_deploy.sh:133 +msgid "\\nInput was not a number, aborting.\\n" +msgstr "\\nLa réponse n'était pas un nombre, annulation.\\n" + +#: linux_server_deploy.sh:137 +msgid "\\nInput was 0, nothing to do.\\n" +msgstr "\\nLa réponse était 0, rien à faire.\\n" + +#: linux_server_deploy.sh:140 +#, sh-format +msgid "Got $CLIENT_NUMBER...\\n" +msgstr "Reçu $CLIENT_NUMBER...\\n" + +#: linux_server_deploy.sh:151 +#, sh-format +msgid "First IP is $IP_RANGE_3B$IP ...\\n" +msgstr "Première IP : $IP_RANGE_3B$IP ...\\n" + + +#: linux_server_deploy.sh:162 +msgid "Got host list : $HOST_LIST \\n" +msgstr "Liste des hôtes : $HOST_LIST \\n" + +#: linux_server_deploy.sh:165 +#, sh-format +msgid "Generating SSL crt/key for $HOST_LIST...\\n" +msgstr "Génération du certificat SSL pour $HOST_LIST...\\n" + +#: linux_server_deploy.sh:179 +#, sh-format +msgid "1/14 : Imaging $SDCARD with the file $DISK_IMAGE ...\\n" +msgstr "1/14 : Ecriture du fichier $DISK_IMAGE sur $SDCARD ...\\n" + +#: linux_server_deploy.sh:180 +#, sh-format +msgid "" +"Are you sure you want to ERASE THE CONTENT of $SDCARD ? Type uppercase 'yes' " +"to confirm." +msgstr "" +"Etes vous certain de vouloir EFFACER LE CONTENU de $SDCARD ? Entrez le mot 'oui' en majuscules " +"pour confirmer." + +#: linux_server_deploy.sh:182 linux_server_deploy.sh:326 +msgid "YES" +msgstr "OUI" + +#: linux_server_deploy.sh:184 +msgid "Answer was different from 'YES'. Aborting..." +msgstr "La réponse était différente de 'OUI'. Annulation..." + +#: linux_server_deploy.sh:187 +#, sh-format +msgid "Received answer $GO_DD. Running dd on $SDCARD in 5 seconds." +msgstr "Réponse reçue ; $GO_DD. Exécution de dd sur $SDCARD dans 5 secondes." + +#: linux_server_deploy.sh:193 +#, sh-format +msgid "2/14 : Unmounting $BOOT_MOUNT and $ROOTFS_MOUNT ...\\n" +msgstr "2/14 : Démontage de $BOOT_MOUNT et $ROOTFS_MOUNT ...\\n" + +#: linux_server_deploy.sh:199 +#, sh-format +msgid "3/14 : Remounting $BOOT_MOUNT and $ROOTFS_MOUNT ...\\n" +msgstr "3/14 : Remontage de $BOOT_MOUNT et $ROOTFS_MOUNT ...\\n" + +#: linux_server_deploy.sh:206 +#, sh-format +msgid "" +"4/14 : Changing hostname to $HOST_NAME in $ROOTFS_MOUNT/etc/hostname and " +"$ROOTFS_MOUNT/etc/hosts ...\\n" +msgstr "" +"4/14 : Changement du nom d'hôte à $HOST_NAME dans $ROOTFS_MOUNT/etc/hostname et " +"$ROOTFS_MOUNT/etc/hosts ...\\n" +#: linux_server_deploy.sh:215 +#, sh-format +msgid "5/14 : Enabling SSH server on boot : $BOOT_MOUNT/ssh ...\\n" +msgstr "5/14 : Activation du serveur SSH au démarrage : $BOOT_MOUNT/ssh ...\\n" + +#: linux_server_deploy.sh:221 +#, sh-format +msgid "" +"6/14 : Generating private/public SSH key as $HOME/.ssh/$HOST_NAME ...\\n" +msgstr "" +"6/14 : Génération de clés privée/publique SSH dans $HOME/.ssh/$HOST_NAME ...\\n" + +#: linux_server_deploy.sh:225 +#, sh-format +msgid "" +"New SSH key pair generated as $HOME/.ssh/$HOST_NAME. Add to ~/.ssh/config ? " +"(y/n)" +msgstr "" +"Nouvelle paire de clés SSH générée dans $HOME/.ssh/$HOST_NAME. Ajouter à ~/.ssh/config ? " +"(o/n)" + +#: linux_server_deploy.sh:227 +msgid "y" +msgstr "o" + +#: linux_server_deploy.sh:228 +#, sh-format +msgid "Adding $HOST_NAME with ip $HOST in $HOME/.ssh/config" +msgstr "Ajout de $HOST_NAME avec ip $HOST dans $HOME/.ssh/config" + +#: linux_server_deploy.sh:234 +msgid "\\nAnswer was different from 'y', skipping..." +msgstr "\\nLa réponse était différente de 'o'. Annulation..." + +#: linux_server_deploy.sh:237 +#, sh-format +msgid "" +"7/14 : Installing public SSH key $HOME/.ssh/$HOST.pub in $ROOTFS_MOUNT/home/" +"$PI_USER/.ssh/authorized_keys...\\n" +msgstr "" +"7/14 : Installation de la clé SSH publique $HOME/.ssh/$HOST.pub dans $ROOTFS_MOUNT/home/" +"$PI_USER/.ssh/authorized_keys...\\n" + +#: linux_server_deploy.sh:243 +#, sh-format +msgid "" +"8/14 : Disabling SSH password based login in $ROOTFS_MOUNT/etc/ssh/" +"sshd_config ...\\n" +msgstr "" +"8/14 : Désactivation de la connexion SSH par mot de passe dans $ROOTFS_MOUNT/etc/ssh/" +"sshd_config ...\\n" + +#: linux_server_deploy.sh:249 +#, sh-format +msgid "" +"9/14 : Configuring wireless connection to $SSID with pw $PASSWD : ...\\n" +msgstr "" +"9/14 : Configuration de la connexion sans fil au réseau $SSID avec le mot de passe $PASSWD : ...\\n" + +#: linux_server_deploy.sh:268 +#, sh-format +msgid "10/14 : Setting static IP $HOST in $ROOTFS_MOUNT/etc/dhcpcd.conf...\\n" +msgstr "10/14 : Réglage de l'IP statique $HOST dans $ROOTFS_MOUNT/etc/dhcpcd.conf...\\n" + +#: linux_server_deploy.sh:280 +#, sh-format +msgid "" +"12/14 : Installing http auth secrets in $CONFIG_DIR/pilpil-server.toml, " +"$ROOTFS_MOUNT/home/pil/.config/systemd/user/vlc.service and $ROOTFS_MOUNT/" +"home/pil/pilpil-client/defaults.toml...\\n" +msgstr "" +"12/14 : Installation du secret d'authentification http dans $CONFIG_DIR/pilpil-server.toml, " +"$ROOTFS_MOUNT/home/pil/.config/systemd/user/vlc.service et $ROOTFS_MOUNT/" +"home/pil/pilpil-client/defaults.toml...\\n" + +#: linux_server_deploy.sh:288 +#, sh-format +msgid "" +"13/14 : Syncing media folder $LOCAL_MEDIA_DIR/ with $REMOTE_MEDIA_DIR/ \\n" +msgstr "" +"13/14 : Synchronisation des médias présents dans $LOCAL_MEDIA_DIR/ avec $REMOTE_MEDIA_DIR/ \\n" + +#: linux_server_deploy.sh:298 +#, sh-format +msgid "Space available on rootfs : $ROOTFS_AVAILABLE_SPACE sectors" +msgstr "Espace disponible sur rootfs : $ROOTFS_AVAILABLE_SPACE secteurs" + +#: linux_server_deploy.sh:301 +#, sh-format +msgid "Size of medias : $MEDIA_SIZE sectors" +msgstr "Taille des médias : $MEDIA_SIZE secteurs" + +#: linux_server_deploy.sh:312 +#, sh-format +msgid "Not enough space on $ROOTFS_MOUNT, skipping..." +msgstr "Pas assez d'espace sur' $ROOTFS_MOUNT, saut..." + +#: linux_server_deploy.sh:316 +msgid "14/14 : Unmounting filesystems" +msgstr "14/14 : Démontage des systèmes de fichier" + +#: linux_server_deploy.sh:324 +msgid "" +"Please swap sd card in reader and enter uppercase 'yes' then Return to proceed with next client or directly hit Return to exit:" +msgstr "" +"Veuillez changer la carte SD dans le lecteur et entrer le mot 'oui' en majuscules suivie de la touche Entrée pour continuer " +"avec le client suivant ou appuyer seulement sur la touche Entrée pour quitter:" + +#: linux_server_deploy.sh:328 +msgid "Answer was different from 'YES'. Aborting...\\n" +msgstr "La réponse était différente de 'OUI'. Annulation...\\n" + +#: linux_server_deploy.sh:334 +msgid "All done !" +msgstr "Finis !" + +#: linux_server_deploy.sh:340 +msgid "Nothing more to do." +msgstr "Rien de plus à faire." diff --git a/fr/LC_MESSAGES/linux_server_deploy.sh.mo b/fr/LC_MESSAGES/linux_server_deploy.sh.mo new file mode 100644 index 0000000000000000000000000000000000000000..b6d48f661fe4c77105af9a419eb71aadab3eb0eb GIT binary patch literal 6683 zcmcIoTaP106)wmPCXj?AT#|692?pn~ZqMu`**FQi-f_>YiS3!#o&=&G)6-qHYqwq9 z>FS=@2?)ePA|!-(AqWWxA@Pum6eJ#ag9jw@08-!qfj|faDG?IC0`Z-y_HAbN5(L(G zK40o`>YVSK^OfJe`{vge9w+epB%WV?A7f7f|Negb!{fI%F?JgGJD>pm8~6k;xS6rX zfIkMhz&`_j34Gud#_GVo06z^}zLl{v!1Foo0{eLXCa?m$=QhSRfGwZ`{s7no-tqy) zE&^Ww(*8dME&=}vBwODFI>5U=$k>;F=YU1v4}r_TU+4G^@DaSf8IwN_ECW9U+yK&e z0elwtT_COZ58yq(J8rk@JP7-0O@@U+yTA`gp1gnAGUVh z1N;o$p9g*p_*EcW%w7fFju+nsp2hp`-@#Z0{5^03xOS)g{5!x+y#EdG55RlxVyp*z z7x*ZR`v_x?10x{C<8@#Jd>gn9Y~9UR8~7UVYrua22fzS_41jL|Y5&!G8M_U52}tWC zK>GXusDSSPPXV9(sP)?`Ksx`=fb{tvf%gG#{TO2$$bk;93iN?-{{Bxu{IQ!5j0b`D z1HS@%8u%9QM?gCN@Dq$Z4E#Cp9Pn>I;?4cog#7z0;A6m7fDZwG1tdHE2_*mCcfUnC z6GCb@L;i=Eh7V)|j%3b2e4qzWo?-jIHmLZ%B zp)$SzFwpPF1EFD`#}g@H9&{d#C!M#5Cn&%`BZd@Vpt*S<+~xuL8NVUjrjO6kE6yL` zYl-kusRn!)r8Y8XCUrz==G3=%;;Dh)h5A;n zU2Sc+<&&prT3Muid2w!8@9R{IO0)HKxzOpBMf5`Ur4O?srTLx=L%t*U$ivr|xmsR5%`3b<@&+`y(5bCe+cgYJhddn$-j^Zl zt<^iv^y!&k!rKl+GcCLzR|1I+vQk>_$z6V?25!mqfvO`&{o4} zBxqRK>?8-dD}!=|N#)(pcWAQo1@}~NwYm8=ekg@X%Yo>7S(s|GUvB%U+ync{C&Nb~ zkRIQ!U4b!egOHaENO{O9D$({`n8HHtE2m_lB+1kfz^(cHI% z3-GM<>(L|R0m`jwi|Lv-GAp-aZ3vp0Xhb?y-bnB?vVrZjs!jL!=nf}ik9w8pO<(KW zxHI;^uJU$F&^w)r2sZ_kBae0>NDmYntyn*gYSgf5pM6sjFVL2G@@xoTM(|NuIALk2IgMcQ_ImzU|jOVg>=1Xe>tD=wukrI5FRh8aD z?DpVu)SA9XkTblWL?d4OvfC*-yt)%5L~J7R1?AXqm1h;f3fFbah%C*S3556 zUUWICL)UF}dDNfQuXDV+9}Awvu}FM)mlyYiF48n(eKK;GbsG#$P`@KoOa^Mc!+eNH*VLy3P#kLf&W08Oesr}X@c7eQjb%Z)Yp?F)QS)$0iIEj1# zubD(q;tG_2X%!qHwNVK7`B0{FQ($shVQt|Hxl8`GNmJO^?A2<{w0*HS3rtc)OkqQEN;*5>(W_8K3v$>T}h4qk5s? z_BvbDwb|Tl4VqWDbEwOr`o>;5?4?o9x_fD73{#;AR^ zl|+}|qEbC5Jtqxaqj?6+iF1gBw3RFmivpX_f%BAf1z=%Q~WIT=}s%lX5e1H6g z=FdYh@&J<$DOxjeJC&$G`BcF}kEhtjhgb}XBmgHBki@N7<9{M=-7Dh*KQlrbiAd^} zYdOl`bVLX>D)Te+qIt0k%8{yoDDz}GFLqtf7I_SNGw54?D3R{-5*Mvznt-GHqTlixJL8q*72mL2)?#MJo9CCwZ$j zCE+RrnQG_5#u@q?Bb}?bazgcj`m~?X&LAymUoYbU+~g$*x#@Z`dVHY92PC9vA%Px- zAfdO(-SI)LsEORPuC;uo0_Vh{&5=b#JzWyzfmStZ7>S){%YrgD;`$ihyjOV*>%BS8 znBs)qiT+Fnq+`Thf+B$^3B1(M6vym(!-{+1kkf56@f$Zd3WXs(&uY(512>S+vECoe# zQ!tE7ThR8i^UkX2HIC4N3q%NilD;?5wpmT=A6Uzg+}Frw@PZf!52JP+5&aQ~{w-)R z%AS`|=7g2~Xqv^v1_Bv}HiqM~Hhx5*aK#}wf<@7g69L^Hjdms$($6gByGcl~J%s;r zB7?ZZJ~~GGhm-MfhMx$a_RWIew2X)Jp8{(x1#~?$l%dMwCGf4rJ%I9FTye1G>@qN0 z9r6jk%O#{`?37N;ItXqIAsPi3h|&xj6B=bR_&BcWOzukKbS#xdkix<+oIF0^F|I8c zR+$uo{N6w_$#h(Gy*SSHF+vOQ-}DqxBv)DRrA(%X6)qN&luw9if&2 + red "`gettext \"Please specify an existing device block for your sd-card, e.g: '/dev/sda'.\"`" >&2 exit 0 fi DD_BS="128K" DISK_IMAGE="$HOME/niels/imgs/2022-10-25-pilpil-WIP.img.xz" if [[ ! -f "$DISK_IMAGE" ]]; then - red "Disk image not found, aborting..." >&2 + red "`gettext \"Disk image not found, aborting...\"`" >&2 exit 0 fi CONFIG_DIR="$HOME/niels/pilpil-server" if [[ ! -d "$CONFIG_DIR" ]]; then - red "Config directory not found, aborting..." >&2 + red "`gettext \"Config directory not found, aborting...\"`" >&2 exit 0 fi HTTP_SECRET=$(openssl rand -base64 12) @@ -78,7 +83,7 @@ ROOTFS_MOUNT="/run/media/$USER/rootfs" #~ LOCAL_MEDIA_DIR="$HOME/Videos" LOCAL_MEDIA_DIR="$HOME/niels/medias" if [[ ! -d "$LOCAL_MEDIA_DIR" ]]; then - red "Medias directory not found, aborting..." >&2 + red "`gettext \"Medias directory not found, aborting...\"`" >&2 exit 0 fi REMOTE_MEDIA_DIR="$ROOTFS_MOUNT/home/$PI_USER/Videos" @@ -97,7 +102,7 @@ CHAN="802-11-wireless.channel 1" # # 0. Create AP connection # -green " * Creating hotspot connection for NetworkManager \n" +green "`gettext \" * Creating hotspot connection in NetworkManager \n\"`" if [[ ! "$DRY_RUN" ]]; then # If connection exists, delete it nmcli con delete $SSID @@ -109,7 +114,7 @@ if [[ ! "$DRY_RUN" ]]; then nmcli con modify $SSID wifi-sec.psk $PASSWD fi # 0.a set IP range on server -green " * Setting IP range $IP_RANGE/24 in /etc/NetworkManager/system-connections/$SSID.nmconnection ... \n" +green "`eval_gettext \" * Setting IP range \\\$IP_RANGE/24 in /etc/NetworkManager/system-connections/\\\$SSID.nmconnection ... \n\"`" if [[ ! "$DRY_RUN" ]]; then sudo sed -i "/method=shared/a address1=$IP_RANGE/24, $IP_RANGE" /etc/NetworkManager/system-connections/$SSID.nmconnection # Remove existing leases @@ -122,18 +127,18 @@ if [[ ! "$DRY_RUN" ]]; then fi # 0.b ask for number of clients # This will be used to determine static IP -yellow "Nombre de clients à configurer : " +yellow "`gettext \"Number of clients to configure : \"`" read -n 4 CLIENT_NUMBER # Check input if [[ ! "${CLIENT_NUMBER}" =~ ^[0-9]+$ ]]; then - red "\nInput was not a number, aborting.\n" + red "`gettext \"\nInput was not a number, aborting.\n\"`" exit 0 fi if [[ "${CLIENT_NUMBER}" -lt 1 ]]; then - red "\nInput was 0, nothing to do.\n" + red "`gettext \"\nInput was 0, nothing to do.\n\"`" exit 0 fi -green "Got $CLIENT_NUMBER...\n" +green "`eval_gettext \"Got \\\$CLIENT_NUMBER...\n\"`" # For some reason networkmanager finds it clever to offer only IPs in range 10-255 even when asked for a /24, /28, etc... # So IPs start at 10 # Get first IP in specified range @@ -143,7 +148,7 @@ IP=10 #~ echo -e "First IP is $(($RANGE_START)) ...\n" # Remove IP's last byte IP_RANGE_3B=$(echo $IP_RANGE | awk -F. '{print $1"."$2"."$3"."}') -echo -e "First IP is $IP_RANGE_3B$IP ...\n" +echo -e "`eval_gettext \"First IP is \\\$IP_RANGE_3B\\\$IP ...\n\"`" # Generate SSL cert with IPs in IP_RANGE IP_CNT=$IP IP_ARRAY=() @@ -155,10 +160,10 @@ do done # Convert array to string HOST_LIST="$(IFS=","; echo "${IP_ARRAY[*]}")" -green "Got host list : ${HOST_LIST-} \n" +green "`eval_gettext \"Got host list : \\\$HOST_LIST \n\"`" # 5. Generate valid ssl cert/key for every IP in range # https://unix.stackexchange.com/questions/104171/create-ssl-certificate-non-interactively -green "Generating SSL crt/key for $HOST_LIST...\n" +green "`eval_gettext \"Generating SSL crt/key for \\\$HOST_LIST...\n\"`" if [[ ! "$DRY_RUN" ]]; then openssl req -new -newkey rsa:4096 -days 1825 -nodes -x509 \ -subj "/C=/ST=Denial/L=/O=/CN=$IP_RANGE$FIRST" \ @@ -172,34 +177,33 @@ do HOST=$(echo $HOST | awk -F: '{print $2}') HOST_NAME="pilpil-$(echo $HOST | awk -F. '{print $4}')" # 1. Copy img to sd - green "1/14 : Imaging $SDCARD with the file $DISK_IMAGE ...\n" - red "Are you sure you want to ERASE THE CONTENT of $SDCARD ? Type uppercase 'yes' to confirm." + green "`eval_gettext \"1/14 : Imaging \\\$SDCARD with the file \\\$DISK_IMAGE ...\n\"`" + red "`eval_gettext \"Are you sure you want to ERASE THE CONTENT of \\\$SDCARD ? Type uppercase 'yes' to confirm.\"`" read -n 4 GO_DD - if [[ "$GO_DD" != "YES" ]] + if [[ "$GO_DD" != "`gettext \"YES\"`" ]] then - red "Answer was different from 'YES'. Aborting..." >&2 + red "`gettext \"Answer was different from 'YES'. Aborting...\"`" >&2 break fi - red "Received answer $GO_DD. Running dd on $SDCARD in 5 seconds." + red "`eval_gettext \"Received answer \\\$GO_DD. Running dd on \\\$SDCARD in 5 seconds.\"`" if [[ ! "$DRY_RUN" ]]; then sleep 5 fi GO_DD=0 # unmount / remount new filesystem - green "2/14 : Unmounting $BOOT_MOUNT and $ROOTFS_MOUNT ...\n" + green "`eval_gettext \"2/14 : Unmounting \\\$BOOT_MOUNT and \\\$ROOTFS_MOUNT ...\n\"`" if [[ ! "$DRY_RUN" ]]; then umount $BOOT_MOUNT umount $ROOTFS_MOUNT xzcat "$DISK_IMAGE" | sudo dd of=$SDCARD bs="$DD_BS" oflag=dsync status=progress && sync fi - green "3/14 : Remounting $BOOT_MOUNT and $ROOTFS_MOUNT ...\n" - echo "Remounting..." + green "`eval_gettext \"3/14 : Remounting \\\$BOOT_MOUNT and \\\$ROOTFS_MOUNT ...\n\"`" if [[ ! "$DRY_RUN" ]]; then sleep 1 systemctl --user restart gvfs-udisks2-volume-monitor sleep 3 fi - green "4/14 : Changing hostname to $HOST_NAME in $ROOTFS_MOUNT/etc/hostname and $ROOTFS_MOUNT/etc/hosts ...\n" + green "`eval_gettext \"4/14 : Changing hostname to \\\$HOST_NAME in \\\$ROOTFS_MOUNT/etc/hostname and \\\$ROOTFS_MOUNT/etc/hosts ...\n\"`" if [[ ! "$DRY_RUN" ]]; then # Change hostname echo "$HOST_NAME" | sudo tee "$ROOTFS_MOUNT/etc/hostname" @@ -208,41 +212,41 @@ do echo -e "127.0.1.1\t$HOST_NAME" | sudo tee -a "$ROOTFS_MOUNT/etc/hosts" fi ## Enable SSH - green "5/14 : Enabling SSH server on boot : $BOOT_MOUNT/ssh ...\n" + green "`eval_gettext \"5/14 : Enabling SSH server on boot : \\\$BOOT_MOUNT/ssh ...\n\"`" if [[ ! "$DRY_RUN" ]]; then touch "$BOOT_MOUNT/ssh" sync fi ## Generate SSH private/public key and install it - Disable passwd login - green "6/14 : Generating private/public SSH key as $HOME/.ssh/$HOST_NAME ...\n" + green "`eval_gettext \"6/14 : Generating private/public SSH key as \\\$HOME/.ssh/\\\$HOST_NAME ...\n\"`" if [[ ! "$DRY_RUN" ]]; then ssh-keygen -t ed25519 -f "$HOME/.ssh/$HOST_NAME" -N "" fi - red "New SSH key pair generated as $HOME/.ssh/$HOST_NAME. Add to ~/.ssh/config ? (y/n)" + red "`eval_gettext \"New SSH key pair generated as \\\$HOME/.ssh/\\\$HOST_NAME. Add to ~/.ssh/config ? (y/n)\"`" read -n 2 ADD_SSH_CONF - if [[ "$ADD_SSH_CONF" == "y" ]];then - green "Adding $HOST_NAME with ip $HOST in $HOME/.ssh/config" + if [[ "$ADD_SSH_CONF" == "`gettext \"y\"`" ]];then + green "`eval_gettext \"Adding \\\$HOST_NAME with ip \\\$HOST in \\\$HOME/.ssh/config\"`" if [[ ! "$DRY_RUN" ]]; then # Add to ~/.ssh/config echo -e "\nHost $HOST_NAME\n\tHostname $HOST\n\tIdentityFile ~/.ssh/$HOST_NAME\n\tUser $PI_USER" | tee -a "$HOME/.ssh/config" fi else - yellow "\nAnswer was different from 'y', skipping..." + yellow "`gettext \"\nAnswer was different from 'y', skipping...\"`" fi # Copy public key to rpi - green "7/14 : Installing public SSH key $HOME/.ssh/$HOST.pub in $ROOTFS_MOUNT/home/$PI_USER/.ssh/authorized_keys...\n" + green "`eval_gettext \"7/14 : Installing public SSH key \\\$HOME/.ssh/\\\$HOST.pub in \\\$ROOTFS_MOUNT/home/\\\$PI_USER/.ssh/authorized_keys...\n\"`" if [[ ! "$DRY_RUN" ]]; then sudo cp "$HOME/.ssh/$HOST_NAME.pub" "$ROOTFS_MOUNT/home/$PI_USER/.ssh/authorized_keys" sync fi # Disable PW login - green "8/14 : Disabling SSH password based login in $ROOTFS_MOUNT/etc/ssh/sshd_config ...\n" + green "`eval_gettext \"8/14 : Disabling SSH password based login in \\\$ROOTFS_MOUNT/etc/ssh/sshd_config ...\n\"`" if [[ ! "$DRY_RUN" ]]; then echo -e "PasswordAuthentication no\nChallengeResponseAuthentication no\nUsePAM no" | sudo tee -a "$ROOTFS_MOUNT/etc/ssh/sshd_config" sync fi # 3. Configure wifi with static IP - green "9/14 : Configuring wireless connection to $SSID with pw $PASSWD : ...\n" + green "`eval_gettext \"9/14 : Configuring wireless connection to \\\$SSID with pw \\\$PASSWD : ...\n\"`" if [[ ! "$DRY_RUN" ]]; then echo "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 @@ -261,19 +265,19 @@ network={ sync fi # Request specific IP to dhcp server - green "10/14 : Setting static IP $HOST in $ROOTFS_MOUNT/etc/dhcpcd.conf...\n" + green "`eval_gettext \"10/14 : Setting static IP \\\$HOST in \\\$ROOTFS_MOUNT/etc/dhcpcd.conf...\n\"`" if [[ ! "$DRY_RUN" ]]; then echo -e "interface wlan0\nrequest $HOST" | sudo tee -a "$ROOTFS_MOUNT/etc/dhcpcd.conf" sync fi # 5. Install previously generated SSL key/crt - green "11/14 : Installing SSL : $CONFIG_DIR/selfCA.crt and $CONFIG_DIR/selfCA.key in $ROOTFS_MOUNT/etc/ssl/certs/ and $ROOTFS_MOUNT/etc/ssl/private/nginx-selfsigned.key...\n" + green "`eval_gettext \"11/14 : Installing SSL : \\\$CONFIG_DIR/selfCA.crt and $CONFIG_DIR/selfCA.key in \\\$ROOTFS_MOUNT/etc/ssl/certs/ and \\\$ROOTFS_MOUNT/etc/ssl/private/nginx-selfsigned.key...\n\"`" if [[ ! "$DRY_RUN" ]]; then sudo cp "$CONFIG_DIR/selfCA.crt" "$ROOTFS_MOUNT/etc/ssl/certs/nginx-selfsigned.crt" sudo cp "$CONFIG_DIR/selfCA.key" "$ROOTFS_MOUNT/etc/ssl/private/nginx-selfsigned.key" sync fi - green "12/14 : Installing http auth secrets in $CONFIG_DIR/pilpil-server.toml, $ROOTFS_MOUNT/home/pil/.config/systemd/user/vlc.service and $ROOTFS_MOUNT/home/pil/pilpil-client/defaults.toml...\n" + green "`eval_gettext \"12/14 : Installing http auth secrets in \\\$CONFIG_DIR/pilpil-server.toml, \\\$ROOTFS_MOUNT/home/pil/.config/systemd/user/vlc.service and \\\$ROOTFS_MOUNT/home/pil/pilpil-client/defaults.toml...\n\"`" if [[ ! "$DRY_RUN" ]]; then #~ Change VLC/pilpil http auth secret sed -i "s:secret:$HTTP_SECRET:g" "$CONFIG_DIR/pilpil-server.toml" @@ -281,7 +285,7 @@ network={ sed -i "s:secret:$HTTP_SECRET:g" "$ROOTFS_MOUNT/home/pil/pilpil-client/defaults.toml" fi #~ # 6. Copy medias - green "13/14 : Syncing media folder $LOCAL_MEDIA_DIR/ with $REMOTE_MEDIA_DIR/ \n" + green "`eval_gettext \"13/14 : Syncing media folder \\\$LOCAL_MEDIA_DIR/ with \\\$REMOTE_MEDIA_DIR/ \n\"`" if [[ ! "$DRY_RUN" ]]; then # Remove filler file if [[ -f "$REMOTE_MEDIA_DIR/remove_me" ]]; then @@ -291,10 +295,10 @@ network={ if [[ -d "$ROOTFS_MOUNT" ]]; then # Get available space on rootfs ROOTFS_AVAILABLE_SPACE=$(df -t ext4 -P "$ROOTFS_MOUNT" | tail -1 | awk '{print $4}') - yellow "Space available on rootfs : $ROOTFS_AVAILABLE_SPACE sectors" + yellow "`eval_gettext \"Space available on rootfs : \\\$ROOTFS_AVAILABLE_SPACE sectors\"`" # Get Media folder size MEDIA_SIZE=$(du -c "$LOCAL_MEDIA_DIR" | tail -1 | awk '{print $1}') - yellow "Size of medias : $MEDIA_SIZE sectors" + yellow "`eval_gettext \"Size of medias : \\\$MEDIA_SIZE sectors\"`" fi if [[ ! "$DRY_RUN" ]]; then # Only copy files if enough space available @@ -305,32 +309,35 @@ network={ sudo chown -R $USER_ID:$GROUP_ID "$REMOTE_MEDIA_DIR" sync else - red "Not enough space on $ROOTFS_MOUNT, skipping..." + red "`eval_gettext \"Not enough space on \\\$ROOTFS_MOUNT, skipping...\"`" fi fi # Unmount FS - green "14/14 : Unmounting filesystems" + green "`gettext \"14/14 : Unmounting filesystems\"`" if [[ ! "$DRY_RUN" ]]; then umount "$BOOT_MOUNT" umount "$ROOTFS_MOUNT" fi - yellow "Client $(($IP-9))/$CLIENT_NUMBER done." + yellow "`eval_gettext \"Client $(($IP-9))/$CLIENT_NUMBER.\"`" #~ echo "$IP / $(($IP_CNT-1))" if [[ "$IP" -lt "$(($IP_CNT-1))" ]]; then - red "Please swap sd card in reader and enter uppercase 'yes' to proceed with next client or hit Ctrl-C:" + red "`gettext \"Please swap sd card in reader and enter uppercase 'yes' then Return to proceed with next client or directly hit Return to exit:\"`" read -n 4 GO_ON - if [ "$GO_ON" != "YES" ] + if [ "$GO_ON" != "`gettext \"YES\"`" ] then - red "Answer was different from 'YES'. Aborting...\n" >&2 + red "`gettext \"Answer was different from 'YES'. Aborting...\n\"`" >&2 break fi GO_ON=0 ((IP++)) else - green "All done !" - exit 1 + green "`gettext \"All done !\"`" + # Remove SSL private key + #~ rm -f "$CONFIG_DIR/selfCA.key" + break fi done -yellow "Nothing more to do." -exit 0 -#~ rm "$CONFIG_DIR/selfCA.key" \ No newline at end of file +# Remove SSL private key +rm -f "$CONFIG_DIR/selfCA.key" +yellow "`gettext \"Nothing more to do.\"`" +exit 1