icecast improvements
[distro-setup] / ffs
diff --git a/ffs b/ffs
index 9efc9f0ebc75e454a076cd01bfa047200632b027..d63668b6e45b3736e479b37ba1851f32351b9df4 100755 (executable)
--- a/ffs
+++ b/ffs
@@ -143,12 +143,22 @@ fi
 
 ##### end command line parsing ########
 
-host=live.iankelling.org:443
-if ip n show 10.2.0.1 | grep . &>/dev/null && \
-    [[ $(dig +timeout=1 +short @10.2.0.1 -x 10.2.0.2 2>&1 ||:) == kd.b8.nz. ]]; then
+host=live.iankelling.org:8443
+live_host=$(dig +timeout=1 +short @iankelling.org live.iankelling.org)
+vps_host=$(dig +timeout=1 +short iankelling.org)
+if [[ $live_host != "$vps_host" ]] &&  ip n show 10.2.0.1 | grep . &>/dev/null && \
+     [[ $(dig +timeout=1 +short @10.2.0.1 -x 10.2.0.2 2>&1 ||:) == kd.b8.nz. ]]; then
   host=127.0.0.1:8000
+else
+  find_prefix="ssh live.iankelling.org"
+fi
+
+if $find_prefix find /var/icecast -type f | grep .; then
+  echo "warning: suggest clearing /var/icecast with icrmr or moving files. sleeping for 4 seconds"
+  sleep 4
 fi
 
+
 pass=$(sed -n 's/ *<source-password>\([^<]*\).*/\1/p' /p/c/icecast.xml)
 
 
@@ -360,8 +370,6 @@ if $watch; then
   rm -f $HOME/.iank-stream-on
 fi
 
-
-
 ### begin background/development docs ###
 
 # zmq vs stdin commands: