Turning off forums via a shell script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Simetrical
    Senior Member
    • Jul 2005
    • 1401
    • 3.8.x

    Turning off forums via a shell script

    I've adapted the shell script from here to turn off my forums before backup using
    Code:
    mysql -e "UPDATE setting SET value=0 WHERE varname='bbactive'"
    The problem is that I have to somehow refresh the datastore for this to take effect, apparently. Is there some easy way to do this from a shell script running as root?
    System Administrator, Total War Center

    Developer, MediaWiki
  • Floris
    Senior Member
    • Dec 2001
    • 37767

    #2
    Code:
    UPDATE datastore SET data=REPLACE(data,'s:8:"bbactive";i:1;','s:8:"bbactive";i:0;') WHERE title='options';
    UPDATE setting SET value=0 WHERE varname='bbactive';

    Comment

    • Wayne Luke
      vBulletin Technical Support Lead
      • Aug 2000
      • 73979

      #3
      Run both these queries to turn your forums off:

      Code:
      UPDATE datastore SET data=REPLACE(data,'s:8:"bbactive";i:1;','s:8:"bbactive";i:0;') WHERE title='options';
      Code:
      UPDATE setting SET value=0 WHERE varname='bbactive';
      Run both these queries to turn your forums back on:

      Code:
      UPDATE datastore SET data=REPLACE(data,'s:8:"bbactive";i:0;','s:8:"bbactive";i:1;') WHERE title='options';
      Code:
      UPDATE setting SET value=1 WHERE varname='bbactive';
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud demonstration site.
      vBulletin 5 API

      Comment

      • Simetrical
        Senior Member
        • Jul 2005
        • 1401
        • 3.8.x

        #4
        Thanks! I thought I was subscribed to this thread, but apparently not. Won't this fail with APC, however? Would I have to run a command through PHP to actually update the datastore being used?
        System Administrator, Total War Center

        Developer, MediaWiki

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...