voice-changer/trainer/setup.sh
2022-08-23 09:45:05 +09:00

21 lines
450 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 参考:https://programwiz.org/2022/03/22/how-to-write-shell-script-for-option-parsing/
set -eu
# 実行ユーザ作成
USER_ID=${LOCAL_UID:-9001}
GROUP_ID=${LOCAL_GID:-9001}
echo ""
echo "アプリケーション開始... (内部ユーザー [UID : $USER_ID, GID: $GROUP_ID]"
useradd -u $USER_ID -o -m user
groupmod -g $GROUP_ID user
#su user
# echo "parameter: $@"
exec /usr/sbin/gosu user /bin/bash exec.sh "$@"
#/bin/bash