This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is a very noddy script to do 302 redirects to load balance between servers | |
// as listeners connect. It does no caching, supports a single stream only and requires | |
// Icecast 2.4 or above (because it uses the status-json.xsl page). | |
// The server, the minimum users before load balancing, the maximum users, the servers | |
// are considered in order from top to bottom | |
$servers = array( | |
array("http://server1:8000/", 10, 100), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
zeroize_macaddrs () | |
{ | |
sed -e 's/\(\s\)\([0-9a-f]\):/\10\2:/' -e 's/\([^0-9a-f]\)\([0-9a-f]\):/\10\2:/g' -e 's/:\([0-9a-f]\)$/:0\1/' | |
} | |
find_ip4 () | |
{ | |
grep 'on-dhcp-event' /etc/hosts | zeroize_macaddrs | grep "$1" | while read ip dns _ mac ; do |