Skip to content
Snippets Groups Projects
deploy.sh 739 B
Newer Older
Laurent Modolo's avatar
Laurent Modolo committed
#!/bin/bash

# This script is executed on the virtual machine during the *Deployment* phase.
# It is used to apply parameters specific to the current deployment.
# It is executed secondly during a cloud deployement in IFB-Biosphere, after the *Installation* phase.

USER_LOGIN=etudiant
USER_PASSWORD=$( openssl rand -hex 12 )
Laurent Modolo's avatar
Laurent Modolo committed
useradd -m -s /bin/bash -g users -G adm,docker,dialout,cdrom,floppy,audio,dip,video,plugdev,netdev ${USER_LOGIN}
Laurent Modolo's avatar
Laurent Modolo committed
cp /etc/skel/.* /home/${USER_LOGIN}/

passwd ${USER_LOGIN} << EOF
${USER_PASSWORD}
${USER_PASSWORD}
EOF
Laurent Modolo's avatar
Laurent Modolo committed

HOST_NAME=$( ss-get --timeout=3 hostname )
HTTP_ENDP="https://$HOST_NAME"
ss-set url.service "${HTTP_ENDP}"
Laurent Modolo's avatar
Laurent Modolo committed
ss-set ss:url.service "[HTTPS]$HTTP_ENDP,[LOGIN]$USER_LOGIN,[PASSWORD]$USER_PASSWORD"