2 # XXX: This should be removed when elixir's releases get custom command support
3 if [ -z "$1" ] || [ "$1" = "help" ]; then
4 echo "Usage: $(basename "$0") COMMAND [ARGS]
6 The known commands are:
8 create Create database schema (needs to be executed only once)
9 migrate Execute database migrations (needs to be done after updates)
10 rollback [VERSION] Rollback database migrations (needs to be done before downgrading)
12 and any mix tasks under Pleroma namespace, for example \`mix pleroma.user COMMAND\` is
13 equivalent to \`$(basename "$0") user COMMAND\`
15 By default pleroma_ctl will try calling into a running instance to execute non migration-related commands,
16 if for some reason this is undesired, set PLEROMA_CTL_RPC_DISABLED environment variable
19 SCRIPT
=$(readlink -f "$0")
20 SCRIPTPATH
=$(dirname "$SCRIPT")
21 if [ "$1" = "migrate" ] || [ "$1" = "rollback" ] || [ "$1" = "create" ] || [ -n "$PLEROMA_CTL_RPC_DISABLED" ]; then
22 "$SCRIPTPATH"/pleroma
eval 'Pleroma.ReleaseTasks.run("'"$*"'")'
24 "$SCRIPTPATH"/pleroma rpc
'Pleroma.ReleaseTasks.run("'"$*"'")'