How to delete site?

Clovertech Forums Cloverleaf How to delete site?

  • Creator
    Topic
  • #114782
    Stewart
    Participant

      How do you delete a site?  The new installation came with a helloworld site by default and I would like to remove.

      Also, how do you change the default site that was set during installation?

    Viewing 6 reply threads
    • Author
      Replies
      • #114783
        Keith McLeod
        Participant

          To set the default go to options–> root preferences and select the site you wish to be your default site under “Default Site”.

          For helloworld, you can go to your root directory <something>/cis19.1/integrator/server and remove from the environs setting the path to helloworld in your server.ini file.

          environs=/hci/cis19.1/integrator/helloworld;/hci/cis19.1/integrator/test

          goes to

          environs=/hci/cis19.1/integrator/test

          This removes it as a selection choice only and can be added back in if you choose to by reversing the process

        • #114784
          James Nelson
          Participant

            1.  Remove the site from the ‘environs=’ line in the $HCIROOT/server/server.ini file
            2.  Delete the $HCIROOT/helloworld directory tree
            3.  To change the default site, change the ‘site=’ line in the $HCIROOT/rootInfo file
            4.  Restart your host server

          • #114785
            Paul Bishop
            Participant

              You probably don’t have anything in the helloworld site, but make sure to stop all threads and daemons before removing the site.

              Paul Bishop
              Carle Foundation Hospital
              Urbana, IL

            • #114831
              Charlie Bursell
              Participant

                A simple script I wrote a long time ago to remove sites.  Put in contrib directory

                For Windows, add .htc suffix/

              • #114832
                Charlie Bursell
                Participant

                  A simple script I wrote a long time ago to remove sites.  Put in contrib directory

                  For Windows, add .htc suffix/

                   

                  Note: Would not let me upload script.  So remove .txt after download

                • #114833
                  Charlie Bursell
                  Participant

                    STILL would not let me upload!  So here is script.

                    !/usr/bin/env tcl

                    # This script will prompt for a site name then remove that site directory and
                    # remove the site from the server.ini file.

                    # The user must have read/write permissions to the site directory and all of
                    # the files within or the site delete will fail.

                    proc main {argv argc} {

                    global env argv0 tcl_platform

                    # The get the root path
                    set root $env(HCIROOT)

                    # The name of the procedure
                    set myname [lindex [split [file tail $argv0] .] 0]

                    # Test for a single argument
                    if {$argc != 1 || [string equal -nocase [lindex $argv 0] -h]} {
                    puts stderr “\nUsage:\t$myname <sitename>\t Where:”
                    puts stderr “\t sitename = Name of site to remove\n”
                    exit -1
                    }

                    # Get site name
                    set site [lindex $argv 0]

                    # Validate that the site exists
                    if {![file isdirectory [file join $root $site]]} {
                    puts stderr “\n$myname: Site $site does not exist in $root\n”
                    exit -1
                    }

                    # If not sure, bail out now!
                    puts stdout “\n$myname: WARNING!! This is a very dangerous command!”
                    puts -nonewline stdout “Site $site will be removed from $root. OK? \[n\] ”
                    flush stdout
                    gets stdin ans

                    # If any response other than Y{es}, bail out
                    if {![regexp -nocase {^Y} $ans]} {
                    puts stdout “\n$myname: requested exit – done\n”
                    exit
                    }

                    # Tell em what we are doing
                    puts stdout “\n$argv – Attempting to remove $site directory from $root\n”

                    # Attempt to remove the site directory
                    if {[catch {file delete -force [file join $root $site]} err]} {
                    puts stderr “\n$myname: Cannot remove site $site\n$err\n”
                    exit -1
                    }

                    # Site directory was removed. Now remove site from server.ini

                    # Path to server.ini file
                    set svr [file join $root server server.ini]

                    # A regsub pattern of the site to remove
                    # Note that the entry will end with ; unless the last entry
                    # + = 0 or 1 instances of the preceeding character
                    set pat “[file join $root $site];?”

                    # If on windows, use backslash
                    if {[regexp -nocase — {^WIN} $tcl_platform(os)]} {
                    regsub -all — {/} $pat {\\\\} pat
                    }

                    # Read the server.ini file
                    if {[catch {read_file -nonewline $svr} inidata]} {
                    puts stderr “\n$myname: Cannot open $svr – $inidata\n”
                    exit -1
                    }

                    # regsub out the site entry

                    if {![regsub — $pat $inidata {} inidata]} {
                    puts stderr “\n$myname: $site not found in $svr file. $svr not changed\n”
                    exit -1
                    } else {

                    # Write the modified server.ini file back
                    if {[catch {write_file $svr $inidata} err]} {
                    puts stderr “\n$myname: Cannot replace $svr – $err\n”
                    exit -1
                    }
                    }

                    # All done
                    puts stdout “\n$myname: $site successfully removed\n”
                    }

                    main $argv $argc

                  • #114837
                    Stewart
                    Participant

                      Thank you.

                  Viewing 6 reply threads
                  • You must be logged in to reply to this topic.