Re-work entrypoint when/if we get bash (or make compatible with sh) #2

Closed
opened 2021-05-06 11:38:54 +00:00 by decentral1se · 3 comments
Owner

a723573bf3/entrypoint.sh.tmpl is bash only but we only have sh on the container. So, we could raise an issue for that on peertube itself. Otherwise, we could make this file_env function sh compatible. For now, I'm just gonna make it really not smart and do it manually.

https://git.autonomic.zone/coop-cloud/peertube/src/commit/a723573bf39b93d7c9d9c3a0e2ffba78aaf8a648/entrypoint.sh.tmpl is `bash` only but we only have `sh` on the container. So, we could raise an issue for that on `peertube` itself. Otherwise, we could make this `file_env` function `sh` compatible. For now, I'm just gonna make it really not smart and do it manually.
Author
Owner

In entrypoint.sh line 6:
   local var="$1"
   ^-- SC2039: In POSIX sh, 'local' is undefined.


In entrypoint.sh line 7:
   local fileVar="${var}_FILE"
   ^-- SC2039: In POSIX sh, 'local' is undefined.


In entrypoint.sh line 8:
   local def="${2:-}"
   ^-- SC2039: In POSIX sh, 'local' is undefined.


In entrypoint.sh line 10:
   if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
         ^-- SC2039: In POSIX sh, indirect expansion is undefined.
                            ^-- SC2039: In POSIX sh, indirect expansion is undefined.


In entrypoint.sh line 15:
   local val="$def"
   ^-- SC2039: In POSIX sh, 'local' is undefined.


In entrypoint.sh line 17:
   if [ "${!var:-}" ]; then
         ^-- SC2039: In POSIX sh, indirect expansion is undefined.


In entrypoint.sh line 18:
      val="${!var}"
           ^-- SC2039: In POSIX sh, indirect expansion is undefined.


In entrypoint.sh line 19:
   elif [ "${!fileVar:-}" ]; then
           ^-- SC2039: In POSIX sh, indirect expansion is undefined.


In entrypoint.sh line 20:
      val="$(< "${!fileVar}")"
           ^-- SC2039: In POSIX sh, $(<file) to read files is undefined.
                ^-- SC2039: In POSIX sh, indirect expansion is undefined.

``` In entrypoint.sh line 6: local var="$1" ^-- SC2039: In POSIX sh, 'local' is undefined. In entrypoint.sh line 7: local fileVar="${var}_FILE" ^-- SC2039: In POSIX sh, 'local' is undefined. In entrypoint.sh line 8: local def="${2:-}" ^-- SC2039: In POSIX sh, 'local' is undefined. In entrypoint.sh line 10: if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then ^-- SC2039: In POSIX sh, indirect expansion is undefined. ^-- SC2039: In POSIX sh, indirect expansion is undefined. In entrypoint.sh line 15: local val="$def" ^-- SC2039: In POSIX sh, 'local' is undefined. In entrypoint.sh line 17: if [ "${!var:-}" ]; then ^-- SC2039: In POSIX sh, indirect expansion is undefined. In entrypoint.sh line 18: val="${!var}" ^-- SC2039: In POSIX sh, indirect expansion is undefined. In entrypoint.sh line 19: elif [ "${!fileVar:-}" ]; then ^-- SC2039: In POSIX sh, indirect expansion is undefined. In entrypoint.sh line 20: val="$(< "${!fileVar}")" ^-- SC2039: In POSIX sh, $(<file) to read files is undefined. ^-- SC2039: In POSIX sh, indirect expansion is undefined. ```
Author
Owner
> https://github.com/Chocobozzz/PeerTube/issues/4047
Author
Owner

Losing my mind, it was there all along.

Losing my mind, it was there all along.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/peertube#2
No description provided.