Skip to content
Snippets Groups Projects
Commit 9ea93a82 authored by Bob Mottram's avatar Bob Mottram
Browse files

Adding users should have return value

parent 538fadbe
No related branches found
No related tags found
No related merge requests found
......@@ -229,9 +229,10 @@ do
if [[ $(function_exists "add_user_${app_name}") == "1" ]]; then
echo $"Adding user to ${app_name}"
app_load_variables "${app_name}"
retval=$("add_user_${app_name}" "$ADD_USERNAME" "$NEW_USER_PASSWORD" | tail -n 1)
if [[ $retval != '0' ]]; then
echo $"Failed with error code ${retval}"
retval=$("add_user_${app_name}" "$ADD_USERNAME" "$NEW_USER_PASSWORD")
retval_last_value=$(echo "$retval" | tail -n 1)
if [[ $retval_last_value != '0' ]]; then
echo $"Failed with error code ${retval_last_value}"
"${PROJECT_NAME}-rmuser" "$ADD_USERNAME" --force
exit 672392
fi
......
......@@ -61,10 +61,12 @@ function logging_off_mailpile {
function remove_user_mailpile {
remove_username="$1"
"${PROJECT_NAME}-pass" -u "$remove_username" --rmapp mailpile
echo "0"
}
function add_user_mailpile {
"${PROJECT_NAME}-pass" -u "$1" -a mailpile -p "$2"
echo "0"
}
function install_interactive_mailpile {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment