                                          ___
                             ,----.     ,--.'|_
                            /   /  \-.  |  | :,'   __  ,-.
                 ,--,  ,--,|   :    :|  :  : ' : ,' ,'/ /|
                 |'. \/ .`||   | .\  ..;__,'  /  '  | |' |
                 '  \/  / ;.   ; |:  ||  |   |   |  |   ,'
                  \  \.' / '   .  \  |:__,'| :   '  :  /
                   \  ;  ;  \   `.   |  '  : |__ |  | '
                  / \  \  \  `--'""| |  |  | '.'|;  : |
                ./__;   ;  \   |   | |  ;  :    ;|  , ;
                |   :/\  \ ;   |   | :  |  ,   /  ---'
                `---'  `--`    `---'.|   ---`-'
                                 `---`                                 07/2017
------------------------------------------------------------------------------

                                    XFiles                                     
                                Second Release                                 
                             For Mystic BBS 1.12+                              

Software --------------------------------------------------------------------
       [ ] PCB PPe      [ ] OBV          [ ] VGA         [ ] OTHER___________
       [ ] Renegade     [ ] Iiniquity    [ ] ASCII       [ ] HTML/CGI/WWW
       [x] Mystic       [ ] WWVI         [ ] Telegard    [x] MPL
       [ ] ANSI         [ ] TEXT
OS --------------------------------------------------------------------------
    [ ] dos  [ ] os/2  [ ] windows [ ] Win32 [x] *nix [x] RPI Linux
Type ------------------------------------------------------------------------
                infoform [ ]   utility [ ]  misc [x]  door [ ]

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                  ____  _           __      _
                 / __ \(_)_________/ /___ _(_)___ ___  ___  _____
                / / / / / ___/ ___/ / __ `/ / __ `__ \/ _ \/ ___/
               / /_/ / (__  ) /__/ / /_/ / / / / / / /  __/ /
              /_____/_/____/\___/_/\__,_/_/_/ /_/ /_/\___/_/

   The author has taken every precaution to insure that no harm or damage
will occur on computer systems operating this util.  Never the less, the
author will NOT be held liable for whatever may happen on your computer
system or to any computer systems which connects to your own as a result of
operating this util.  The user assumes full responsibility for the correct
operation of this software package, whether harm or damage results from
software error, hardware malfunction, or operator error.  NO warranties are
offered, expressly stated or implied, including without limitation or
restriction any warranties of operation for a particular purpose and/or
merchant ability.  If you do not agree with this then do NOT use this
program.


-------------------------------------------------------------------------------
                ____                      _       __  _
               / __ \___  _______________(_)___  / /_(_)___  ____
              / / / / _ \/ ___/ ___/ ___/ / __ \/ __/ / __ \/ __ \
             / /_/ /  __(__  ) /__/ /  / / /_/ / /_/ / /_/ / / / /
            /_____/\___/____/\___/_/  /_/ .___/\__/_/\____/_/ /_/
                                       /_/

  Instead of upload files through the Mystic BBS, file base manager, you can
add any part of a hard drive or even whole hdd/usb drives, in a blink of the
eye.

  Lets say you have a RPi for a BBS and you want to add USB drives with files
for your BBS, but also have an easy way to 1) add them 2) not having issues if
you remove the USB stick/drive 3) add more USB sticks and expand the file
system of your BBS.

  With this script you are pointing a directory and then the user can navigate
and download files, from that directory and also in the sub directories of it.
You can add any description for files or directories, by just adding a .DIZ
file. Included in the package is a BASH script to auto generate .DIZ files
from ZIPs and/or use the file utility of Linux to add descriptions for other
file types.

  You can add descriptions online with the internal text editor, on the fly,
if you are the Sys Admin. Also a new feature is Remote Files.

  What are remote files? An example. If you want your users to have the
latest version of a program, you can add a remote file descriptor and when
the users select to download that file, it will first download it from the
Internet and then automatically, download to the users computer.

  Another use of remote files, is that you can point to local files, that are
in another area (ex. file base) and also have them in your XFiles file area.
This way, you don't have duplicate files on your system, for different file
areas (XFiles and Mystics File Bases).

-------------------------------------------------------------------------------
                ____           __        ____      __  _
               /  _/___  _____/ /_____ _/ / /___ _/ /_(_)___  ____
               / // __ \/ ___/ __/ __ `/ / / __ `/ __/ / __ \/ __ \
             _/ // / / (__  ) /_/ /_/ / / / /_/ / /_/ / /_/ / / / /
            /___/_/ /_/____/\__/\__,_/_/_/\__,_/\__/_/\____/_/ /_/

.oO Unzip the archive inside Mystics Scripts folder. Everything needed is inside
the package.

.oO Compile the script with mplc

    ./mplc xq-xfiles.mps

.oO Inside the <script>/xq-xfiles folder, is the script to use for adding .DIZ
    description files. Make it executable:

    chmod +x ./makediz.sh

    ... and move/copy it inside the directory you want to use. Execute it:

    ./makediz.sh

    ...and it will create or necessary files. Edit the file to make it add,
    descriptions for other filetypes. Currently supports ZIP files. It gets the
    original FILE_ID.DIZ from the ZIP file.

    Make sure you have wget installed on your system, cause this script,
    needs it.

-------------------------------------------------------------------------------
           ______            _____                        __  _
          / ____/___  ____  / __(_)___ ___  ___________ _/ /_(_)___  ____
         / /   / __ \/ __ \/ /_/ / __ `/ / / / ___/ __ `/ __/ / __ \/ __ \
        / /___/ /_/ / / / / __/ / /_/ / /_/ / /  / /_/ / /_/ / /_/ / / / /
        \____/\____/_/ /_/_/ /_/\__, /\__,_/_/   \__,_/\__/_/\____/_/ /_/
                               /____/

  Just edit the files (ANS, MPS, SH) to get the script to your preferences.
  For basic stuff, changing the constants on top of the file will do.

-------------------------------------------------------------------------------
                           __  __
                          / / / /________ _____ ____
                         / / / / ___/ __ `/ __ `/ _ \
                        / /_/ (__  ) /_/ / /_/ /  __/
                        \____/____/\__,_/\__, /\___/
                                        /____/

    Insert a command inside your menu, with Mystic Configuration, like this:

  Usage           : xq-xfiles <directory>

  No options are needed.

  Example:

          Command | (GX) Execute MPL program
             Data | xq-xfiles /media/pi
           Access |
          Execute | Select

  Put the makediz.sh file inside the directory you specified ex. /media/pi and
  execute it: ./makediz.sh

  It will find all files and create/extract description files for each one. It
  creates a new file with .DIZ extension and name, as the name of the file it
  found. .DIZ files are not displayed inside the menu system as files, but only
  as text in the right description area.

  You can make descriptions for directories also. Create a file with the name
  of the directory and extension .DIZ and place it in the parent directory.

  Example:

  +-- gba         // This is a directory
  +-- gba.diz     // ... and this is the description file for it.
  +-- nes
  +-- nes.diz

-------------------------------------------------------------------------------

                 ___               _         ___ _ _        
                | _ \___ _ __  ___| |_ ___  | __(_) |___ ___
                |   / -_) '  \/ _ \  _/ -_) | _|| | / -_|_-<
                |_|_\___|_|_|_\___/\__\___| |_| |_|_\___/__/

  By now, you know what Remote FIles are, but lets explain how they work.

To add a remote file, you create a text file that its final extension is .xrl
For example, lets add a remote file to download the latest build of Mystic BBS.

Create a text file in one of your directories, with CTRL-C (from inside the
script). Give it a name like:

                            mysticbbs_linux.zip.xrl

NOTICE that the file ends with .xrl, but from the script you will only see
the mysticbbs_linux.zip filename. 

Add the following text:

name=mystic_for_linux.zip
size=102 kb
link=http://www.mysticbbs.com/downloads/mys112a34_l32.rar

Its self explanatory. The first line is the name of the remote file or a
small description. Its simple text and it doesn't matter whatever you enter
here.

You can enter a size number in the size field or leave it blank.

The link field is important! You can add any HTTP link that specifies a file,
or even FTP links to point to a file on the Internet. If you want to point to
a local file, add the full path and filename of that file. In our example, if
you have MysticBBS on another file area, enter the full path and filename...
for example:

              /home/pi/mystic/files/bbstools/mystic112A34_L64.zip

Thats it. The user can download the file from the Internet, through your BBS
and always have the latest version of it.

-------------------------------------------------------------------------------
                                _______ __
                               / ____(_) /__  _____
                              / /_  / / / _ \/ ___/
                             / __/ / / /  __(__  )
                            /_/   /_/_/\___/____/


+-- file_id.diz
+-- sysop.txt
+-- xq-xfiles
|   +-- xq-xfiles.ans           // ANSI Screen
|   +-- makediz.sh              // BASH Script to populate .DIZ files
+-- xq-xfiles.mps               // Mystic Script

------------------------------------------------------------------------------
            _______                   ____  ___      __
           / ____(_)  _____  _____  _/_/ / / (_)____/ /_____  _______  __
          / /_  / / |/_/ _ \/ ___/_/_// /_/ / / ___/ __/ __ \/ ___/ / / /
         / __/ / />  </  __(__  )/_/ / __  / (__  ) /_/ /_/ / /  / /_/ /
        /_/   /_/_/|_|\___/____/_/  /_/ /_/_/____/\__/\____/_/   \__, /
                                                                /____/


.oO First Release...  04/2017
.oO Second Release... 07/2017
    - Virtual/Remote Files
    - Add custom descriptions
    - Create Directories and Text Files
    - Add Sysop commands
    - Minor fixes

-------------------------------------------------------------------------------
                       ______            __             __
                      / ____/___  ____  / /_____ ______/ /_
                     / /   / __ \/ __ \/ __/ __ `/ ___/ __/
                    / /___/ /_/ / / / / /_/ /_/ / /__/ /_
                    \____/\____/_/ /_/\__/\__,_/\___/\__/

Liked this script? Want more? Make a visit at my BBS and think of living a 
donation to my Paypal account. :)

   _            _   _              ___          _    _       
  /_\  _ _  ___| |_| |_  ___ _ _  |   \ _ _ ___(_)__| |               8888
 / _ \| ' \/ _ \  _| ' \/ -_) '_| | |) | '_/ _ \ / _` |            8 888888 8
/_/ \_\_||_\___/\__|_||_\___|_|   |___/|_| \___/_\__,_|            8888888888
                                                                   8888888888
         DoNt Be aNoTHeR DrOiD fOR tHe SySteM                      88 8888 88
                                                                   8888888888
    .o HaM RaDiO    .o ANSi ARt!       .o MySTiC MoDS              "88||||88"
    .o NeWS         .o WeATheR         .o FiLEs                     ""8888""
    .o GaMeS        .o TeXtFiLeS       .o PrEPardNeSS                  88
    .o TuTors       .o bOOkS/PdFs      .o SuRVaViLiSM          8 8 88888888888
    .o FsxNet       .o SurvNet         .o More...            888 8888][][][888
                                                               8 888888##88888
   TeLNeT : andr01d.zapto.org:9999 [UTC 11:00 - 20:00]         8 8888.####.888
   SySoP  : xqtr                   eMAiL: xqtr.xqtr@gmail.com  8 8888##88##888
------------------------------------------------------------------------------

