voice-changer/trainer/setup.sh

21 lines
450 B
Bash
Raw Normal View History

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