Revision: 6094
          http://ipcop.svn.sourceforge.net/ipcop/?rev=6094&view=rev
Author:   dotzball
Date:     2011-11-17 06:37:06 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
Add 'config' option to restartsquid to call squid.conf createscript from GUI.
For now only called from urlfilter.cgi not in proxy.cgi.

Modified Paths:
--------------
    ipcop/trunk/html/cgi-bin/urlfilter.cgi
    ipcop/trunk/lfs/misc-progs
    ipcop/trunk/src/misc-progs/restartsquid.c
    ipcop/trunk/src/scripts/makesquidconf
    ipcop/trunk/updates/2.0.2/ROOTFILES.i486-2.0.2

Modified: ipcop/trunk/html/cgi-bin/urlfilter.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/urlfilter.cgi      2011-11-16 23:11:22 UTC (rev 
6093)
+++ ipcop/trunk/html/cgi-bin/urlfilter.cgi      2011-11-17 06:37:06 UTC (rev 
6094)
@@ -2742,6 +2742,7 @@
 
     &General::writehash("/var/ipcop/proxy/redirector/urlfilter", 
\%redirectorconf);
 
+    system('/usr/local/bin/restartsquid --config');
 }
 
 # -------------------------------------------------------------------

Modified: ipcop/trunk/lfs/misc-progs
===================================================================
--- ipcop/trunk/lfs/misc-progs  2011-11-16 23:11:22 UTC (rev 6093)
+++ ipcop/trunk/lfs/misc-progs  2011-11-17 06:37:06 UTC (rev 6094)
@@ -81,8 +81,6 @@
        for i in cc configure gcc make Make; do \
                ln -sf /usr/local/bin/compile.help "/usr/local/bin/$$i"; \
        done
-       # Change owner, GUI needs to be able to rewrite
-       chown nobody.nobody /usr/local/bin/redirectwrapper
 
        # lib files containing helper subs
        mkdir -p /usr/lib/ipcop

Modified: ipcop/trunk/src/misc-progs/restartsquid.c
===================================================================
--- ipcop/trunk/src/misc-progs/restartsquid.c   2011-11-16 23:11:22 UTC (rev 
6093)
+++ ipcop/trunk/src/misc-progs/restartsquid.c   2011-11-17 06:37:06 UTC (rev 
6094)
@@ -50,12 +50,27 @@
     printf("  -f, --flush           flush proxy cache\n");
     printf("  -r, --repair          repair proxy cache\n");
     printf("  -t, --test            test first, do not start if not 
running\n");
+//    printf("      --config          re-generate squid.conf from proxy 
settings\n");
     printf("  -v, --verbose         be verbose\n");
     printf("      --help            display this help and exit\n");
     exit(exit_code);
 }
 
 
+/*
+    Call helper script to generate squid.conf
+*/
+void config()
+{
+    char command[STRING_SIZE];
+
+    snprintf(command, STRING_SIZE, "/usr/local/bin/makesquidconf");
+    safe_system(command);
+
+    exit(0);
+}
+
+
 /* read the IPsec config file and adds a rule for every net-to-net definition
     that skip the transparent rules REDIRECT
 */
@@ -211,6 +226,7 @@
         { "flush", no_argument, 0, 'f' },
         { "repair", no_argument, 0, 'r' },
         { "test", no_argument, 0, 't' },
+        { "config", no_argument, 0, 'c' },
         { "verbose", no_argument, 0, 'v' },
         { "help", no_argument, 0, 'h' },
         { 0, 0, 0, 0}
@@ -235,6 +251,8 @@
         case 'v':              /* verbose */
             flag_verbose++;
             break;
+        case 'c':
+            config();
         case 'h':
             usage(argv[0], 0);
         default:

Modified: ipcop/trunk/src/scripts/makesquidconf
===================================================================
--- ipcop/trunk/src/scripts/makesquidconf       2011-11-16 23:11:22 UTC (rev 
6093)
+++ ipcop/trunk/src/scripts/makesquidconf       2011-11-17 06:37:06 UTC (rev 
6094)
@@ -1231,6 +1231,9 @@
     }
 
     close FILE;
+
+    # This chown is only needed while developing this script and the proxy.cgi 
also writes the squid.conf
+    system("chown nobody.nobody /var/ipcop/proxy/squid.conf");
 }
 
 # -------------------------------------------------------------------

Modified: ipcop/trunk/updates/2.0.2/ROOTFILES.i486-2.0.2
===================================================================
--- ipcop/trunk/updates/2.0.2/ROOTFILES.i486-2.0.2      2011-11-16 23:11:22 UTC 
(rev 6093)
+++ ipcop/trunk/updates/2.0.2/ROOTFILES.i486-2.0.2      2011-11-17 06:37:06 UTC 
(rev 6094)
@@ -9,6 +9,7 @@
 /usr/lib/ipcop/DataAccess.pl
 /usr/local/bin/makesquidconf
 /usr/local/bin/redirectwrapper
+/usr/local/bin/restartsquid
 /usr/share/locale/af_ZA/LC_MESSAGES/ipcop.mo
 /usr/share/locale/bg_BG/LC_MESSAGES/ipcop.mo
 /usr/share/locale/ca_ES/LC_MESSAGES/ipcop.mo

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ipcop-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to