captaincore/app/account/delete
2020-12-18 18:22:25 -05:00

34 lines
751 B
Bash

#!/usr/bin/env bash
#
# Removes an account from CaptainCore.
#
# `captaincore account delete <account_id>`
#
# Load configuration
root_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; root_path=${root_path%app*}
source ${root_path}lib/arguments
run_command() {
account_id=$1
cd ${root_path}data
if [[ "$site" != "" ]] && [[ "$site_id" != "" ]]; then
wp eval-file ../lib/local-scripts/account-delete.php account_id=$account_id captain_id=$captain_id
fi
}
# See if any sites are specifed
if [ ${#arguments[*]} -eq 1 ]; then
# Runs on specifed sites
run_command ${arguments[*]}
fi
# Error if no sites specifed
if [ ${#arguments[*]} -eq 0 ]; then
echo -e "${COLOR_RED}Error:${COLOR_NORMAL} Please specify an account."
fi