Dump Asterisk Realtime Voicemail users into Voicemail.conf
While I’ve been lazy about updating my site, I have not been lazy with writing new scripts and coming up with ideas to write about.
The first in the set that I’m going to make public is a script to dump your Asterisk Realtime Voicemail database users into a flat voicemail.conf file. I used this technique while troubleshooting to revert back to the standard setup while I was working on the realtime config.
#!/bin/bash function get_mailbox { mailbox=$( mysql -u dbuser --password=dbpass asterisk -e "select mailbox from voicemail_users where uniqueid = '$i'") mailbox=`echo $mailbox | awk '{print $2}'` } function get_password { password=$(mysql -u dbuser --password=dbpass asterisk -e "select password from voicemail_users where uniqueid = '$i'") password=`echo $password | awk '{print $2}'` } function get_fullname { name=$(mysql -u dbuser --password=dbpass asterisk -e "select fullname from voicemail_users where uniqueid = '$i'") name=`echo $name | awk '{print $2}'` } function get_email { email=$(mysql -u dbuser --password=dbpass asterisk -e "select email from voicemail_users where uniqueid = '$i'") email=`echo $email | awk '{print $2}'` } function write_file { echo "$mailbox => $password,$name,$email,,attach=yes|saycid=no|envelope=no|delete=no" >> /root/test_dump.txt } for (( i=1; i<=151; i++)) do get_mailbox get_password get_fullname get_email write_file done
I just got root on my palm pre! Thanks to the guys and gals over at
Notice I used 3 exclamations in the title to convey how excited I am. I’ve been working on developing a new platform that I can better monitor for the Rick Roll Script. I’ve setup a new domain called
A customer requested this script, once I started working on it I realized how useful this could be. I have this setup on a weekly CRON task. The script is very simple, it updates ClamAV and RKHunter then scans the server with both and mails the results to the specified email address. If you plan on adding this script to your server, you might want to ensure that you have the correct versions of ClamAV and RKHunter.
A friend of mine just sent me the following command to open passive ports on a Windows Machine. This is the easiest way to open Passive on a Windows I’ve seen. NOTE: This only works on Windows Server 2008: