MyBB Community Forums

Full Version: [LINUX] One-line MyBB download/extract-er
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Today I was helping someone to figure out what was going wrong with his MyBB installation. To be absolutely sure that he downloaded, extracted and change the modes to the necessary folders and files I created a sexy one-liner.

The world is nothing if we don't share, so:
wget --content-disposition http://www.mybb.com/download/latest -O mybb.zip && unzip mybb.zip "Upload/*" && mv Upload/* . && rm -Rf Upload mybb.zip && mv inc/config.default.php inc/config.php && chmod -R 0777 cache uploads inc/settings.php inc/config.php

This will download and extract the latest MyBB version into the current folder. Make sure you are in the correct folder.

Requirements:
- access to command line interface of the server
- wget must be installed and available for the user
- unzip must be installed and available for the user

REMIXES
=======
by Dylan M. (uses curl instead of wget)
curl http://www.mybb.com/download/latest -o mybb.zip && unzip mybb.zip "Upload/*" && mv Upload/* . && rm -Rf Upload mybb.zip && mv inc/config.default.php inc/config.php && chmod -R 0777 cache uploads inc/settings.php inc/config.php

by Dylan M. (uses aria2 instead of wget). Requires aria2 1.9.3 or above:
aria2c http://www.mybb.com/download/latest -o mybb.zip && unzip mybb.zip "Upload/*" && mv Upload/* . && rm -Rf Upload mybb.zip && mv inc/config.default.php inc/config.php && chmod -R 0777 cache uploads inc/settings.php inc/config.php

by Dylan M. (uses lynx instead of wget).
lynx -crawl -dump http://www.mybb.com/download/latest > mybb.zip && unzip mybb.zip "Upload/*" && mv Upload/* . && rm -Rf Upload mybb.zip && mv inc/config.default.php inc/config.php && chmod -R 0777 cache uploads inc/settings.php inc/config.php
Now that is quite helpful, thank you. Smile
You should also add that the system must have wget installed for this to work (Not all hosts have this installed/available for certain groups).

(2011-04-22, 09:41 PM)Malcolm. Wrote: [ -> ]You should also add that the system must have wget installed for this to work (Not all hosts have this installed/available for certain groups).

Added it, thanks. Although the command is only useful for people with access to the CLI (so on localhost, VPS or dedicated) and in most cases wget and unzip is part of the default tool package or can be installed easily.
Brilliant tutorial, thanks for the share. Smile
boorkmark! Wink
Bookmarked too. This is really useful for installing fresh systems for testing. Great work!
What about alternative downloaders such as aria? Not everyone uses wget. Personally I have wget, aria2 (which has the download command of aria2c), and curl all installed. And all could be used for your command line Smile

I prefer aria2 over the others, but I use it and wget about 50/50, and curl only from inside PHP.
@Dylan: we could even use lynx in a way. curl and wget are the two best though I reckon and wget is the most often used.
(2011-04-25, 04:07 PM)euantor Wrote: [ -> ]@Dylan: we could even use lynx in a way. curl and wget are the two best though I reckon and wget is the most often used.

Yes, I was just teasing the OP a bit Wink

wget is available on ALL *NIX boxes that I've seen, even if not installed. So its the most universal.
Pages: 1 2 3