Working with Asterisk a lot recently at work, I made this kickstart file for CentOS 5.5 32-bit to automatically install the OS, install Asterisk, update the OS, and reboot. Upon first boot you’ll have a fully up to date server with Asterisk already up and running with sample config files and a small selection of music on hold files installed. You’ll still need to add rules to IPTables for sip ports 5060 and 5061. Get the kickstart file from Pastie here.
I was recently asked at work to write a small script that would restart AFP once a week. My boss wanted to get an e-mail with a list of the currently logged in users to AFP along with their respective IP addresses. This is a messy one liner to get most of the information, but it gets the job done:
sudo serveradmin command afp:command = getConnectedUsers | egrep '(ipAddress)|(name)' | sed '$!N;s/\n/ /' | cut -d '"' -f 2,4 | tr '"' '\t'
Here’s the full script: (more…)