summaryrefslogtreecommitdiffstats
path: root/server/bin/setsmbpass
diff options
context:
space:
mode:
authordevega <ma.devega@globunet.com>2019-05-13 10:58:04 +0200
committerdevega <ma.devega@globunet.com>2019-05-13 10:58:04 +0200
commitd619dddd6bc80694096090337e331dc51e7c5ea4 (patch)
treebe46a3b2acce9b617f77eca5fc4c06315be8f82f /server/bin/setsmbpass
parentd624c25993a589197a09ca7998764bd7727eaf08 (diff)
parent992e7e507c33cde23b494cc3d5b3e1e24fab0480 (diff)
Merge remote-tracking branch 'origin/webconsole3' into webconsole3
Diffstat (limited to 'server/bin/setsmbpass')
-rwxr-xr-xserver/bin/setsmbpass10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/bin/setsmbpass b/server/bin/setsmbpass
index 2162b3be..57c354d7 100755
--- a/server/bin/setsmbpass
+++ b/server/bin/setsmbpass
@@ -19,6 +19,7 @@
PROG=$(basename "$0")
PATH=$PATH:$(dirname "$(realpath "$0")")
OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
+OGCFGFILE=$OPENGNSYS/etc/opengnsys.json
SAMBAUSER="opengnsys" # Usuario por defecto.
TFTPDIR=$OPENGNSYS/tftpboot
INITRD=oginitrd.img
@@ -88,8 +89,13 @@ for OGLIVE in $LIST; do
# FIN CĂ“DIGO TEMPORAL.
# Ticket 565, preparar acceso Rsync cliente.
echo "$SAMBAPASS" > scripts/passrsync
- chown root.root scripts/passrsync
- chmod 400 scripts/passrsync
+ # Guardar tokens de seguridad.
+ cat << EOT > scripts/client.cfg
+CLIENTID=$(jq -r .client.id $OGCFGFILE)
+CLIENTSECRET=$(jq -r .client.secret $OGCFGFILE)
+EOT
+ chown root.root scripts/passrsync scripts/client.cfg
+ chmod 400 scripts/passrsync scripts/client.cfg
# Generar Initrd del cliente.
find . | cpio -H newc -oa | gzip -9c > "$CLIENTINITRD"
else