Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
70e29d7c
Commit
70e29d7c
authored
Oct 15, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add restore_jabberd password script
parent
3230488b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
restore_jabberd_passwd.sh
etersoft/restore_jabberd_passwd.sh
+52
-0
No files found.
etersoft/restore_jabberd_passwd.sh
0 → 100755
View file @
70e29d7c
#!/bin/sh
# Written by Vitaly Lipatov <lav@etersoft.ru>, 2012
# restore jabber user password:
# ./restore_jabberd_passwd.sh LOGIN [e-mail]
# supports only im.etersoft.ru now
DB_USER
=
eter_jabber
DB_PASS
=
S7PCfhJj9v9eUMsm
DB_HOST
=
mysql.priv.etersoft.ru
DB
=
eter_jabber
REALM
=
im.etersoft.ru
EMAIL
=
lav@etersoft.ru
mysql_query
()
{
echo
"
$@
"
|
mysql
-s
-N
--default-character-set
=
utf8
--user
=
$DB_USER
--password
=
$DB_PASS
--host
$DB_HOST
$DB
}
LOGIN
=
$1
FORCEEMAIL
=
$2
PASSWORD
=
$(
mysql_query
"SELECT password FROM authreg WHERE
\`
username
\`
=
\"
$LOGIN
\"
AND
\`
realm
\`
=
\"
$REALM
\"
"
)
test
-n
"
$PASSWORD
"
||
exit
echo
"Password:
$PASSWORD
"
if
[
-z
"
$FORCEEMAIL
"
]
;
then
USEREMAIL
=
$(
mysql_query
"SELECT email FROM vcard WHERE
\`
collection-owner
\`
= '
$LOGIN
@
$REALM
' "
)
else
USEREMAIL
=
$FORCEEMAIL
fi
test
-n
"
$USEREMAIL
"
||
fatal
"E-mail is missed in user vcard. You can run this script with user e-email as second arg."
echo
"E-mail:
$USEREMAIL
"
EMAIL
=
$EMAIL
mutt
$USEREMAIL
-s
"Jabber password from im.etersoft.ru"
<<
EOF
Hello,
Your password recovery request for
$LOGIN
@
$REALM
jabber account has handled.
Your current password phrase is '
$PASSWORD
'.
Please, change it immediately via your Jabber client.
With best regards,
Etersoft robot,
$(
LANG
=
C
date
)
EOF
echo
"Mailed from
$EMAIL
to
$USEREMAIL
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment