Remove deprecated dedupe_media from the config template
[akkoma] / rel / pleroma_ctl
1 #!/bin/sh
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]
5
6 The known commands are:
7
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)
11
12 and any mix tasks under Pleroma namespace, for example \`mix pleroma.user COMMAND\` is
13 equivalent to \`$(basename "$0") user COMMAND\`
14
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
17 "
18 else
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("'"$*"'")'
23 else
24 "$SCRIPTPATH"/pleroma rpc 'Pleroma.ReleaseTasks.run("'"$*"'")'
25 fi
26 fi