diff options
author | Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in> | 2022-11-19 02:29:13 +0500 |
---|---|---|
committer | Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in> | 2022-11-19 02:29:13 +0500 |
commit | 23ad0d03ad7be60f50dadad9d279e57be2936568 (patch) | |
tree | 59274e75b25605bc86be7f2a4fa1cd5909ebc96b /www-apps/gotosocial/files | |
parent | profiles: temporarily mask sys-power/gwe (diff) | |
download | guru-23ad0d03ad7be60f50dadad9d279e57be2936568.tar.gz guru-23ad0d03ad7be60f50dadad9d279e57be2936568.tar.bz2 guru-23ad0d03ad7be60f50dadad9d279e57be2936568.zip |
www-apps/gotosocial: update initd service
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
Diffstat (limited to 'www-apps/gotosocial/files')
-rw-r--r-- | www-apps/gotosocial/files/gotosocial.initd | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/www-apps/gotosocial/files/gotosocial.initd b/www-apps/gotosocial/files/gotosocial.initd index 66f9efad8..91ed760c7 100644 --- a/www-apps/gotosocial/files/gotosocial.initd +++ b/www-apps/gotosocial/files/gotosocial.initd @@ -1,17 +1,42 @@ #!/sbin/openrc-run # Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# shellcheck shell=sh disable=SC2034 : ${GOTOSOCIAL_CONFIG:=/etc/gotosocial/config.yaml} +extra_commands="adduser" +description_adduser="create a user" + description="GoToSocial Server" -command=/usr/bin/gotosocial +command="/usr/bin/gotosocial" command_args="--config-path ${GOTOSOCIAL_CONFIG} server start" command_user="gotosocial:gotosocial" -command_background=1 +command_background=yes pidfile="/run/gotosocial.pid" depend() { need net after postgresql } + +adduser() { + # handle Ctrl+C + trap "stty echo" INT + + printf "Enter username: " + read username + + printf "Enter email: " + read email + + stty -echo + printf "Enter password: " + read password + stty echo + + start-stop-daemon --exec "${command}" --user "${command_user}" -- \ + --config-path "${GOTOSOCIAL_CONFIG}" admin account create \ + --username "${username}" --email "${email}" --password "${password}" + return $? +} |