diff --git a/src/reset.sh b/src/reset.sh index 675c4ca..3dcb41f 100644 --- a/src/reset.sh +++ b/src/reset.sh @@ -247,17 +247,23 @@ hasDisk() { } user="admin" -pass="$user" - [ -n "${USER:-}" ] && user="${USER:-}" -[ -n "${PASS:-}" ] && pass="${PASS:-}" + +if [ -n "${PASS:-}" ]; then + + sed -i "s/auth_basic off/auth_basic \"NoVNC\"/g" /etc/nginx/sites-enabled/web.conf + +else + + sed -i "s/auth_basic \"NoVNC\"/auth_basic off/g" /etc/nginx/sites-enabled/web.conf + +fi # Set password -echo "$user:{PLAIN}$pass" > /etc/nginx/.htpasswd +echo "$user:{PLAIN}${PASS:-}" > /etc/nginx/.htpasswd # Start webserver cp -r /var/www/* /run/shm html "Starting $APP for Docker..." nginx -e stderr - return 0