2021-03-26 23:57:31 +01:00
|
|
|
|
|
|
|
xmpp_user_rooms_count() {
|
Update useful_functions/.bash_aliases, README.md
Deleted chaprilinfos/README.md, chaprilinfos/template-chaprilinfos.properties, chaprilinfos/update_chaprilinfos, fail2ban/filter.d/xmpp-flooders.conf, fail2ban/jail.d/chapril-xmpp.conf, fail2ban/README.md, metrology/collectd_exec_xmpp.sh, nodeinfo2/README.md, nodeinfo2/template-x-nodeinfo2.json, nodeinfo2/update_nodeinfo, rapport_activite/update_ticket.sh, useful_functions/functions.sh
2021-10-24 20:34:35 +02:00
|
|
|
sudo -u ejabberd ejabberdctl get_user_rooms ${1} chalec.org | wc -l
|
2021-03-26 23:57:31 +01:00
|
|
|
}
|
|
|
|
xmpp_user_contacts_count() {
|
Update useful_functions/.bash_aliases, README.md
Deleted chaprilinfos/README.md, chaprilinfos/template-chaprilinfos.properties, chaprilinfos/update_chaprilinfos, fail2ban/filter.d/xmpp-flooders.conf, fail2ban/jail.d/chapril-xmpp.conf, fail2ban/README.md, metrology/collectd_exec_xmpp.sh, nodeinfo2/README.md, nodeinfo2/template-x-nodeinfo2.json, nodeinfo2/update_nodeinfo, rapport_activite/update_ticket.sh, useful_functions/functions.sh
2021-10-24 20:34:35 +02:00
|
|
|
sudo -u ejabberd ejabberdctl get_roster ${1} chalec.org | wc -l
|
2021-03-26 23:57:31 +01:00
|
|
|
}
|
|
|
|
xmpp_user_info() {
|
|
|
|
echo "${1}:$(xmpp_user_contacts_count ${1}):$(xmpp_user_rooms_count ${1})"
|
|
|
|
}
|
|
|
|
|
|
|
|
xmpp_users() {
|
Update useful_functions/.bash_aliases, README.md
Deleted chaprilinfos/README.md, chaprilinfos/template-chaprilinfos.properties, chaprilinfos/update_chaprilinfos, fail2ban/filter.d/xmpp-flooders.conf, fail2ban/jail.d/chapril-xmpp.conf, fail2ban/README.md, metrology/collectd_exec_xmpp.sh, nodeinfo2/README.md, nodeinfo2/template-x-nodeinfo2.json, nodeinfo2/update_nodeinfo, rapport_activite/update_ticket.sh, useful_functions/functions.sh
2021-10-24 20:34:35 +02:00
|
|
|
for user in $(sudo -u ejabberd ejabberdctl registered_users chalec.org); do
|
2021-03-26 23:57:31 +01:00
|
|
|
xmpp_user_info "${user}"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
xmpp_ban_user_by_patern() {
|
Update useful_functions/.bash_aliases, README.md
Deleted chaprilinfos/README.md, chaprilinfos/template-chaprilinfos.properties, chaprilinfos/update_chaprilinfos, fail2ban/filter.d/xmpp-flooders.conf, fail2ban/jail.d/chapril-xmpp.conf, fail2ban/README.md, metrology/collectd_exec_xmpp.sh, nodeinfo2/README.md, nodeinfo2/template-x-nodeinfo2.json, nodeinfo2/update_nodeinfo, rapport_activite/update_ticket.sh, useful_functions/functions.sh
2021-10-24 20:34:35 +02:00
|
|
|
LIST=$(sudo -u ejabberd ejabberdctl registered_users chalec.org | grep ${1} | uniq)
|
2021-03-26 23:57:31 +01:00
|
|
|
|
|
|
|
for ADDRESS in $LIST
|
|
|
|
do
|
Update useful_functions/.bash_aliases, README.md
Deleted chaprilinfos/README.md, chaprilinfos/template-chaprilinfos.properties, chaprilinfos/update_chaprilinfos, fail2ban/filter.d/xmpp-flooders.conf, fail2ban/jail.d/chapril-xmpp.conf, fail2ban/README.md, metrology/collectd_exec_xmpp.sh, nodeinfo2/README.md, nodeinfo2/template-x-nodeinfo2.json, nodeinfo2/update_nodeinfo, rapport_activite/update_ticket.sh, useful_functions/functions.sh
2021-10-24 20:34:35 +02:00
|
|
|
sudo -u ejabberd ejabberdctl kick_user $ADDRESS chalec.org
|
|
|
|
sudo -u ejabberd ejabberdctl unregister $ADDRESS chalec.org
|
2021-03-26 23:57:31 +01:00
|
|
|
echo Done with $ADDRESS
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
xmpp_send_server_notice() {
|
Update useful_functions/.bash_aliases, README.md
Deleted chaprilinfos/README.md, chaprilinfos/template-chaprilinfos.properties, chaprilinfos/update_chaprilinfos, fail2ban/filter.d/xmpp-flooders.conf, fail2ban/jail.d/chapril-xmpp.conf, fail2ban/README.md, metrology/collectd_exec_xmpp.sh, nodeinfo2/README.md, nodeinfo2/template-x-nodeinfo2.json, nodeinfo2/update_nodeinfo, rapport_activite/update_ticket.sh, useful_functions/functions.sh
2021-10-24 20:34:35 +02:00
|
|
|
sudo -u ejabberd ejabberdctl send_message headline xmpp-admin@chalec.org \
|
|
|
|
chalec.org/announce/online "Annonce du Serveur" "${1}"
|
2021-03-26 23:57:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
xmpp_send_server_notice_to_connected() {
|
|
|
|
LIST=$(sudo -u ejabberd ejabberdctl connected_users_info | cut -f 1 | cut -d "/" -f 1 | uniq)
|
|
|
|
|
|
|
|
for ADDRESS in $LIST
|
|
|
|
do
|
Update useful_functions/.bash_aliases, README.md
Deleted chaprilinfos/README.md, chaprilinfos/template-chaprilinfos.properties, chaprilinfos/update_chaprilinfos, fail2ban/filter.d/xmpp-flooders.conf, fail2ban/jail.d/chapril-xmpp.conf, fail2ban/README.md, metrology/collectd_exec_xmpp.sh, nodeinfo2/README.md, nodeinfo2/template-x-nodeinfo2.json, nodeinfo2/update_nodeinfo, rapport_activite/update_ticket.sh, useful_functions/functions.sh
2021-10-24 20:34:35 +02:00
|
|
|
sudo -u ejabberd ejabberdctl send_message headline chalec.org "$ADDRESS" "Annonce du Serveur" "${2}"
|
2021-03-26 23:57:31 +01:00
|
|
|
echo Done with $ADDRESS
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
xmpp_send_server_notice_by_pattern() {
|
Update useful_functions/.bash_aliases, README.md
Deleted chaprilinfos/README.md, chaprilinfos/template-chaprilinfos.properties, chaprilinfos/update_chaprilinfos, fail2ban/filter.d/xmpp-flooders.conf, fail2ban/jail.d/chapril-xmpp.conf, fail2ban/README.md, metrology/collectd_exec_xmpp.sh, nodeinfo2/README.md, nodeinfo2/template-x-nodeinfo2.json, nodeinfo2/update_nodeinfo, rapport_activite/update_ticket.sh, useful_functions/functions.sh
2021-10-24 20:34:35 +02:00
|
|
|
LIST=$(sudo -u ejabberd ejabberdctl registered_users chalec.org | grep ${1} | uniq)
|
2021-03-26 23:57:31 +01:00
|
|
|
|
|
|
|
for ADDRESS in $LIST
|
|
|
|
do
|
Update useful_functions/.bash_aliases, README.md
Deleted chaprilinfos/README.md, chaprilinfos/template-chaprilinfos.properties, chaprilinfos/update_chaprilinfos, fail2ban/filter.d/xmpp-flooders.conf, fail2ban/jail.d/chapril-xmpp.conf, fail2ban/README.md, metrology/collectd_exec_xmpp.sh, nodeinfo2/README.md, nodeinfo2/template-x-nodeinfo2.json, nodeinfo2/update_nodeinfo, rapport_activite/update_ticket.sh, useful_functions/functions.sh
2021-10-24 20:34:35 +02:00
|
|
|
sudo -u ejabberd ejabberdctl send_message headline chalec.org "$ADDRESS" "Annonce du Serveur" "${2}"
|
2021-03-26 23:57:31 +01:00
|
|
|
echo Done with $ADDRESS
|
|
|
|
done
|
|
|
|
}
|