faster is better than slow | Download Swift
+ Reply to Thread
Results 1 to 2 of 2

Thread: Swift download tool

  1. #1

    Join Date
    Aug 2011
    Location
    Sao Paulo, Brazil
    Posts
    46


    Lightbulb Swift download tool

    Given the speed new Swift versions are appearing, I wrote a small bash script for use in shell hosting. It's specific to how my ISP work (FreeBSD), but I guess it can be useful for someone else. Feel free to use it, changing it as it best suits your case. And for whatever it's worth, consider it released under a BSDv3 license.

    Code:
    #!/bin/bash
    # swiftget v0.1
    
    if [ "$1" == "" ]; then
      echo "Please provide the full download link."
      exit 1
    fi
    
    USERNAME=""
    PASSWORD=""
    
    THEMES_FOLDER="/home/public/wordpress/wp-content/themes/"
    TMP_FOLDER="/home/tmp/"
    DIR_PERMS="775"
    FIL_PERMS="664"
    GROUP="web"
    
    FILENAME=$(basename "$1")
    FOLDERNAME="${THEMES_FOLDER}$(basename "${FILENAME}" .zip)"
    
    wget -O "${TMP_FOLDER}${FILENAME}" http://swiftthemes.com/swiftlers-area/plugins/protect/new_rewrite/login.php?v=-1\&amember_login=${USERNAME}\&amember_pass=${PASSWORD}\&url=/swiftler-files/${FILENAME} && unzip "${TMP_FOLDER}${FILENAME}" -d ${THEMES_FOLDER} -x \*.DS_Store -x __MACOSX\* && rm "${TMP_FOLDER}${FILENAME}"
    
    if [ $? -eq 0 ]; then
      find "${FOLDERNAME}" -type d -exec chmod ${DIR_PERMS} {} \;
      find "${FOLDERNAME}" -type f -exec chmod ${FIL_PERMS} {} \;
      find "${FOLDERNAME}" -exec chgrp ${GROUP} {} \;
    else
      echo "An error has occurred."
      exit 1
    fi

  2. #2


    nice

    I have to learn this thing sometime, I that i can create a zipped file and upload it automatically.

+ Reply to Thread

Similar Threads

  1. Pre-download questions
    By scoop in forum Support
    Replies: 0
    Last Post: 01-09-2011, 09:28 PM
  2. Swift v5.25 and IE8 Google Adsense preview tool error
    By jeffagogo in forum Bug report and suggestions.
    Replies: 0
    Last Post: 04-02-2010, 08:40 AM
  3. Tool tip
    By chicoi08 in forum Support
    Replies: 0
    Last Post: 03-24-2010, 08:21 AM
  4. Missing files in download
    By clickbridge in forum Bug report and suggestions.
    Replies: 2
    Last Post: 01-30-2010, 11:25 AM
  5. Where can I download Swift 3.0?
    By theconservativeblog in forum Bug report and suggestions.
    Replies: 3
    Last Post: 11-17-2009, 05:48 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts