Description: This is a ssh bash shell script designed for advanced users who want a script to quickly download eFiction for them. This script eliminates the need to manually download the latest eFiction, unzip the files, upload the files, chmod config.php, create a stories folder and chmod it. See below for full list.
This script will do the following:
- Download the eFiction version you specify
- Unzips the eFiction files
- Moves the files to the directory you specify
- Delete the .zip file
- Delete the old eFiction version folder (ex: eFiction351)
- Move the config.php file from /docs (comment the line if you are only doing an upgrade)
- chmod the config file to 666
- Create a stories folder
- chmod the stories folder to 777
What it does not do:
- Create a MySQL database (this may be an upcoming feature if requested!)
- Run actual eFiction installation script for you (ex:yoursite.com/efiction/install)
Requirements:
- SSH access - I've used it with root access, but it should work with jailed SSH
Mod History:
6/20/09 - v1.0 Initial Release
This is the first release, I have tested it, but please keep in mind that this is my first shell script and there may be bugs or errors that need to be reported.
Installation:
1. Copy and paste the following into a blank editor such as MS Notepad:
#!/bin/bash
# EFICTION INSTALL SCRIPT
# WRITTEN BY REBECCA G. (BECCA)
# LAST UPDATE 6/20/09
# VERSION 1.0
# ----IMPORTANT! SET THE VARIABLES BELOW ----
# SET EFICTION VERSION
# No spaces, periods or endings! ex:eFiction[version]
VER=eFiction351
# EFICTION PATH
# Most commonly /home/username/public_html
EFIC=/home/username/public_html
# USERNAME
USER=username
# ---- DO NOT EDIT BELOW THIS LINE! ADVANCED USERS ONLY! ----
# CHANGE TO EFICTION DIRECTORY
cd $EFIC
# GET LATEST EFICTION SCRIPT
wget https://efiction.org/downloads/$VER.zip
echo "DOWNLOADING $VER SCRIPT..."
# UNZIP EFICTION FILE
unzip -aq $VER.zip
echo "UNZIPPING $VER.zip..."
# MOVE EFICTION FILES TO MAIN DIRECTORY
mv $EFIC/$VER/* $EFIC/
echo "MOVING $EFIC FILES TO /PUBLIC_HTML..."
# DELETE EFICTION ZIP FILE
rm $EFIC/$VER.zip
echo "DELETING $VER.zip..."
# EFICTION FOLDER CLEANUP
rm -r $EFIC/$VER
# FIX USER PERMISSIONS
chown -R $USER:$USER $EFIC
# CHMOD PUBLIC_HTML
chmod 755 $EFIC
# MOVE CONFIG FILE
mv $EFIC/docs/config.php $EFIC/config.php
echo "MOVING THE CONFIG FILE TO PUBLIC_HTML"
# CHMOD CONFIG.PHP to 666
chmod 666 $EFIC/config.php
echo "CHMOD CONFIG.PHP TO 666..."
# CREATE STORIES FOLDER
mkdir $EFIC/stories
# CHMOD STORIES FOLDER
chmod 777 $EFIC/stories
# COMPLETION MESSAGE
echo "$EFIC INSTALLATION NOW COMPLETE!"
2. Edit the proper variables and save the file as a .sh file, for example I named mine efiction.sh
3. Upload the .sh file to your server
4. With SSH login using PuTTY or similar program
5. Execute the script by using the following command
sh efiction.sh
6. See if there are any error messages, otherwise 'installation' should be complete!
