This commit was generated by cvs2svn to compensate for changes in r45,
[pingofdeath.git] / status_pod.sh
diff --git a/status_pod.sh b/status_pod.sh
new file mode 100755 (executable)
index 0000000..2431244
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash 
+
+function status_pod()
+{
+
+    local SYSCTL="/sbin/sysctl"
+
+    # Check that IPOD is built into this kernel
+    local version
+    version=`$SYSCTL -n net.ipv4.icmp_ipod_version 2> /dev/null`
+    if [[ $? -ne 0 ]]
+    then
+        echo "Not installed"
+        return 255
+    fi
+
+    # Check if it has been enabled
+    local enabled=`$SYSCTL -n net.ipv4.icmp_ipod_enabled`
+    echo -n "version $version "
+    if [[ $enabled -eq 1 ]]
+    then 
+        echo "Enabled"
+    else 
+        echo "Disabled"
+    fi
+    return $enabled
+}