diff options
Diffstat (limited to 'server/bin')
-rwxr-xr-x | server/bin/setsmbpass | 10 |
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 |