How to clear, reset or Delete Squid Config?



  • anyone can help me to delete the Squid 3 configuration….
    my squid 3 proxy/cache was not working so i remove the package from System->Package Manager i need to install squid 2 but the old settings from Squid 3 still there and do not let me config Squid 2 as it should...
    any idea how to Delete, Clear o Reset that settings?



  • SSH in and delete /var/squid, /usr/local/pkg/squid.* and /usr/local/pkg/squid_.

    Don't delete /usr/local/pkg/squid* or you will lose your Squidguard settings, if it's installed.


  • Rebel Alliance Developer Netgate

    @KOM:

    SSH in and delete /var/squid, /usr/local/pkg/squid.* and /usr/local/pkg/squid_.

    Don't delete /usr/local/pkg/squid* or you will lose your Squidguard settings, if it's installed.

    The settings are in config.xml, not there, so you can remove "/usr/local/pkg/squid*". If you want to reinstall the packages after, make sure to reinstall squid first before trying to reinstall squidGuard.

    As for the settings, if you want to remove those, try this from Diagnostics > Command in the PHP Execute box:

    $squid_sections = array("squid", "squidnac", "squidcache", "squidauth", "squidextauth", "squidtraffic", "squidupstream", "squidusers");
    foreach ($squid_sections as $sec) {
    	if (is_array($config['installedpackages'][$sec]))
    		unset($config['installedpackages'][$sec]);
    }
    write_config("Removed Squid");
    
    

    Or to remove squid, squidguard, lightsquid, and anything else with 'squid' in its package name:

    foreach (array_keys($config['installedpackages']) as $sec) {
    	if (strpos($sec, "squid") !== false)
    		unset($config['installedpackages'][$sec]);
    }
    write_config("Removed all squid-related settings");
    
    

    Not perfect but it should get the job done.

    Either that, or backup the config, edit the settings out, then restore.



  • @KOM:

    SSH in and delete /var/squid, /usr/local/pkg/squid.* and /usr/local/pkg/squid_.

    Don't delete /usr/local/pkg/squid* or you will lose your Squidguard settings, if it's installed.

    Thank you!!



  • @jimp:

    @KOM:

    SSH in and delete /var/squid, /usr/local/pkg/squid.* and /usr/local/pkg/squid_.

    Don't delete /usr/local/pkg/squid* or you will lose your Squidguard settings, if it's installed.

    The settings are in config.xml, not there, so you can remove "/usr/local/pkg/squid*". If you want to reinstall the packages after, make sure to reinstall squid first before trying to reinstall squidGuard.

    As for the settings, if you want to remove those, try this from Diagnostics > Command in the PHP Execute box:

    $squid_sections = array("squid", "squidnac", "squidcache", "squidauth", "squidextauth", "squidtraffic", "squidupstream", "squidusers");
    foreach ($squid_sections as $sec) {
    	if (is_array($config['installedpackages'][$sec]))
    		unset($config['installedpackages'][$sec]);
    }
    write_config("Removed Squid");
    
    

    Or to remove squid, squidguard, lightsquid, and anything else with 'squid' in its package name:

    foreach (array_keys($config['installedpackages']) as $sec) {
    	if (strpos($sec, "squid") !== false)
    		unset($config['installedpackages'][$sec]);
    }
    write_config("Removed all squid-related settings");
    
    

    Not perfect but it should get the job done.

    Either that, or backup the config, edit the settings out, then restore.

    it works! thanks a lot!