From 097e491abce77164309317491ca282c1c0aa0b7b Mon Sep 17 00:00:00 2001 From: jvolkenant Date: Fri, 29 Jul 2016 16:09:03 -0700 Subject: [PATCH] Added tool to change/reset rainloop admin password --- tools/rainloop-unlockadmin.sh | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 tools/rainloop-unlockadmin.sh diff --git a/tools/rainloop-unlockadmin.sh b/tools/rainloop-unlockadmin.sh new file mode 100755 index 00000000..12a53feb --- /dev/null +++ b/tools/rainloop-unlockadmin.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# +# This allows for resetting the password for +# access to Rainloop's Admin panel: +# https://yourdomain.com/mail/?admin +# + +source /etc/mailinabox.conf + + +echo "Tool for resetting Rainloop Admin Password" +echo +echo "Password must be 8 characters or longer." +echo +echo -n "Please provide a new admin password (ctrl-c to cancel):" +read -s newpassword +echo + +if [ -z $newpassword ] +then + echo "Error: Password can not be blank." + exit 1 +fi + +if [ ${#newpassword} -lt 8 ] +then + echo "Error: Password length must be 8 characters or longer." + exit 1 +fi + + +echo "SetPassword('$newpassword'); +echo \$oConfig->Save() ? 'Done' : 'Error'; + +?>" | /usr/bin/php + +echo "" +echo "Login to Rainloop Admin Panel here using your new password:" +echo "Username: admin" +echo "https://$PRIMARY_HOSTNAME/mail/?admin"