diff --git a/.bin/Scripts/diagnostics b/.bin/Scripts/diagnostics index 00fb77b1..107d29bf 100644 --- a/.bin/Scripts/diagnostics +++ b/.bin/Scripts/diagnostics @@ -2,15 +2,30 @@ ## Wizard Kit: SW Diagnostics # Init -## Get .bin absolute path (dirty code roughly based on http://stackoverflow.com/a/12197227) +clear +BIN="" + +# Find BIN path pushd . > /dev/null -cd "$(dirname "$0")/.." -BIN="$(pwd)" +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Prep /WK/Info DATE="$(date "+%F")" -LOG_DIR="/WK/Info" -LOG_FILE="${LOG_DIR}/${DATE}/Diagnostics.log" -mkdir -p "$(dirname "${LOG_FILE}")" 2>/dev/null +LOG_DIR="/WK/Info/${DATE}" +LOG_FILE="${LOG_DIR}/Diagnostics.log" +mkdir -p "${LOG_DIR}" 2>/dev/null # . "$BIN/os_check" # Setup color and message printing @@ -52,55 +67,89 @@ while [[ "${ticket}" == "" ]]; do done # Start +clear print_general "Starting SW Diagnostics" print_general " For ticket #${ticket}" # Sanitize Environment +#TODO # Network +print_general "" print_general "Testing network connection..." while ! ping -c 2 "google.com" >/dev/null 2>&1; do print_warning "System appears offline. Please connect to the internet." echo -n "Press Enter to try again... " read _tmp done +print_general " Connected." # Infection Scan +#TODO # OS Health +print_general "" print_general "Checking disk permissions..." -/usr/libexec/repair_packages --verify --standard-pkgs >> "${LOG_DIR}/permissions.log" -if [[ "$(wc -l "${LOG_DIR}/permissions.log")" -ge "10" ]]; then - head -9 "${LOG_DIR}/permissions.log" | sed 's/^/ /' | tee -a "${LOG_FILE}" - print_general " ... $(echo "$(wc -l "${LOG_DIR}/permissions.log") - 9" | bc) lines omitted" -else +/usr/libexec/repair_packages --verify --standard-pkgs >> "${LOG_DIR}/permissions.log" 2>/dev/null +_log_length="$(cat "${LOG_DIR}/permissions.log" | wc -l | sed 's/ //g')" +if [[ "$_log_length" -eq "0" ]]; then + print_general " No issues found." +elif [[ "$_log_length" -lt "10" ]]; then sed 's/^/ /' "${LOG_DIR}/permissions.log" | tee -a "${LOG_FILE}" +else + head -9 "${LOG_DIR}/permissions.log" | sed 's/^/ /' | tee -a "${LOG_FILE}" + print_general " ...$(echo "$_log_length - 9" | bc) lines omitted" fi +# Check OS/SW Updates +print_general "" +print_general "Checking for available software updates..." +softwareupdate -l | grep '*' | tee -a "${LOG_FILE}" # Browser Backup +#TODO # Temp file size +print_general "" print_general "Checking temp file size..." du -sch ~/.Trash | sed 's/^/ /' | tee -a "${LOG_FILE}" # Save System Info -print_general "System Information:" -# system_profiler -## HW -## Keys? +print_general "" +print_general "Saving system information..." +system_profiler -detailLevel full >> "${LOG_DIR}/system_profiler.txt" +## Installed App list +system_profiler -detailLevel full SPApplicationsDataType >> "${LOG_DIR}/installed-applications.txt" +print_general " Done." + +## Save product keys +#TODO? + ## OS +print_general "" +print_general "Operating System:" sw_vers | sed 's/^/ /' | tee -a "${LOG_FILE}" -## SW +## Free Space +print_general "" +print_general "Drive details:" +system_profiler -detailLevel mini SPStorageDataType | egrep '^\s+\w+:$|Available|Capacity' | tee -a "${LOG_FILE}" -# OS/SW Updates -softwareupdate -l | tee -a "${LOG_FILE}" +## Installed RAM +print_general "" +print_general "Installed memory:" +system_profiler -detailLevel mini SPMemoryDataType | egrep 'DIMM|Size' | sed 's/ //' | tee -a "${LOG_FILE}" +echo " Total: $(($(sysctl -a hw.memsize | sed 's/.*: //')/1024/1024/1024)) Gb" | tee -a "${LOG_FILE}" +# List installed Office Apps +print_general "" +print_general "Installed office applications:" +egrep "Microsoft Word|Microsoft Excel|Microsoft Outlook|Office|office" "${LOG_DIR}/installed-applications.txt" | egrep ':$' | sed 's/://' | tee -a "${LOG_FILE}" # Battery -#ioreg +#TODO - ioreg? # User data size +print_general "" print_general "User data:" pushd /Users >/dev/null for user in $(dscl . -list /Users | grep -Ev '^(_|(daemon|nobody|root)$)'); do @@ -112,7 +161,19 @@ popd >/dev/null # Upload results #rsync -# Open results +# Fix /WK/Info permissions +chmod -R 644 "${LOG_DIR}" +chmod 755 "${LOG_DIR}" # Done +print_general "" +print_general "Done." +echo "" +echo -n "Press Enter to exit..." +read _tmp >/dev/null 2>&1 + +# Open results +/Applications/TextEdit.app/Contents/MacOS/TextEdit "${LOG_FILE}" & + +# Exit exit 0 diff --git a/.bin/Scripts/install_app b/.bin/Scripts/install_app new file mode 100644 index 00000000..0d111cb5 --- /dev/null +++ b/.bin/Scripts/install_app @@ -0,0 +1,140 @@ +#!/bin/bash + +# Init +pushd . > /dev/null +cd "$(dirname "$0")/.." +mkdir install_cache >/dev/null 2>&1 +cd install_cache || exit 1 +TMP_DIR="$(mktemp -d 2>/dev/null || mktemp -d -t 'wktmp')" + +# Functions +## code heavily borrowed from macapps.link +getApp() { + if [ -f "$1" ]; then + echo $'\360\237\214\200 - ['$2'] Copying app...' + cp -n "$1" "$2" + else + echo $'\360\237\214\200 - ['$2'] Downloading app...' + curl "$1" -L -R -f -s -o "$2" -z "$2" + fi +} + +versionChecker() { + local v1=$1 + local v2=$2 + while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do + char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'` + char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}` + v1=`echo $v1 | sed "s/$char/.$char_dec/g"` + done + while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do + char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'` + char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}` + v2=`echo $v2 | sed "s/$char/.$char_dec/g"` + done + v1=`echo $v1 | sed 's/\.\./.0/g'` + v2=`echo $v2 | sed 's/\.\./.0/g'` + checkVersion "$v1" "$v2" +} + +checkVersion() { + [ "$1" == "$2" ] && return 1 + v1f=`echo $1 | cut -d "." -f -1` + v1b=`echo $1 | cut -d "." -f 2-` + v2f=`echo $2 | cut -d "." -f -1` + v2b=`echo $2 | cut -d "." -f 2-` + if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then + [[ "$v1f" -gt "$v2f" ]] && return 1 + [[ "$v1f" -lt "$v2f" ]] && return 0 + [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0 + [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0 + checkVersion "$v1b" "$v2b" + return $? + else + [ "$1" -gt "$2" ] && return 1 || return 0 + fi +} + +appStatus() { + if [ ! -d "/Applications/$1" ]; then + echo "uninstalled" + else + if [[ $5 == "build" ]]; then + BUNDLE="CFBundleVersion" + else + BUNDLE="CFBundleShortVersionString" + fi + INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` + if [ $4 == "dmg" ]; then + COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"` + elif [[ $4 == "zip" || $4 == "tar" ]]; then + COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"` + fi + checkVersion "$INSTALLED" "$COMPARETO" + UPDATED=$? + if [[ $UPDATED == 1 ]]; then + echo "updated" + else + echo "outdated" + fi + fi +} + +installApp() { + getApp "$4" "$2.$1" + cp "$2.$1" "$TMP_DIR/" + pushd "$TMP_DIR" >/dev/null + if [ $1 == "dmg" ]; then + yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null + install_status="$(appStatus "$3" "$2" "" "dmg" "$7")" + if [[ "$install_status" == "updated" ]]; then + echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!' + elif [[ "$install_status" == "outdated" && $6 != "noupdate" ]]; then + ditto "/Volumes/$2/$3" "/Applications/$3" + echo $'\360\237\214\216 - ['$2'] Successfully updated!' + elif [[ "$install_status" == "outdated" && $6 == "noupdate" ]]; then + echo $'\342\235\214 - ['$2'] This app cant be updated!' + elif [[ "$install_status" == "uninstalled" ]]; then + cp -R "/Volumes/$2/$3" /Applications + echo $'\360\237\221\215 - ['$2'] Succesfully installed!' + fi + hdiutil unmount "/Volumes/$2" > /dev/null + elif [ $1 == "zip" ]; then + unzip -qq "$2.zip" + install_status="$(appStatus "$3" "" "$5" "zip" "$7")" + if [[ "$install_status" == "updated" ]]; then + echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!' + elif [[ "$install_status" == "outdated" && $6 != "noupdate" ]]; then + ditto "$5$3" "/Applications/$3" + echo $'\360\237\214\216 - ['$2'] Successfully updated!' + elif [[ "$install_status" == "outdated" && $6 == "noupdate" ]]; then + echo $'\342\235\214 - ['$2'] This app cant be updated!' + elif [[ "$install_status" == "uninstalled" ]]; then + mv "$5$3" /Applications + echo $'\360\237\221\215 - ['$2'] Succesfully installed!' + fi + rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" + elif [[ $1 == "tar" || $1 == "tbz" || $1 == "tgz" || $1 == "txz" ]]; then + tar -zxf "$2.$1" > /dev/null; + install_status="$(appStatus "$3" "" "$5" "tar" "$7")" + if [[ "$install_status" == "updated" ]]; then + echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!' + elif [[ "$install_status" == "outdated" && $6 != "noupdate" ]]; then + ditto "$3" "/Applications/$3" + echo $'\360\237\214\216 - ['$2'] Successfully updated!' + elif [[ "$install_status" == "outdated" && $6 == "noupdate" ]]; then + echo $'\342\235\214 - ['$2'] This app cant be updated!' + elif [[ "$install_status" == "uninstalled" ]]; then + mv "$5$3" /Applications + echo $'\360\237\221\215 - ['$2'] Succesfully installed!' + fi + rm -rf "$2.$1" && rm -rf "$3" + fi + popd > /dev/null +} + +# Install App +installApp "$@" + +# Done +rm -R "$TMP_DIR" diff --git a/.bin/_templates/create_installers b/.bin/_templates/create_installers new file mode 100644 index 00000000..3d08e7e3 --- /dev/null +++ b/.bin/_templates/create_installers @@ -0,0 +1,101 @@ +#!/bin/bash + +# Generate installer commands +cd "$HOME/wk-macos/Installers" + +# Audio-Video +sed 's#___#"dmg" "HandBrake" "HandBrake.app" "http://downloads.sourceforge.net/project/handbrake/0.10.5/HandBrake-0.10.5-MacOSX.6_GUI_x86_64.dmg" "" "" ""#' "install.command" >> "Extras/Audio-Video/HandBrake.command" +chmod +x "Extras/Audio-Video/HandBrake.command" +sed 's#___#"dmg" "Kodi" "Kodi.app" "http://mirrors.kodi.tv/releases/osx/x86_64/kodi-16.1-Jarvis-x86_64.dmg" "" "" ""#' "install.command" >> "Extras/Audio-Video/Kodi.command" +chmod +x "Extras/Audio-Video/Kodi.command" +sed 's#___#"tar" "mpv" "mpv.app" "http://sva.wakku.to/~chris/mpv_builds/mpv_latest.tar.bz2" "" "" ""#' "install.command" >> "Extras/Audio-Video/mpv.command" +chmod +x "Extras/Audio-Video/mpv.command" +sed 's#___#"zip" "Plex" "Plex Media Server.app" "https://downloads.plex.tv/plex-media-server/0.9.16.6.1993-5089475/PlexMediaServer-0.9.16.6.1993-5089475-OSX.zip" "" "" ""#' "install.command" >> "Extras/Audio-Video/Plex.command" +chmod +x "Extras/Audio-Video/Plex.command" +sed 's#___#"dmg" "Spotify" "Spotify.app" "http://download.spotify.com/Spotify.dmg" "" "" ""#' "install.command" >> "Extras/Audio-Video/Spotify.command" +chmod +x "Extras/Audio-Video/Spotify.command" +sed 's#___#"dmg" "VLC" "VLC.app" "http://get.videolan.org/vlc/2.2.4/macosx/vlc-2.2.4.dmg" "" "" ""#' "install.command" >> "Extras/Audio-Video/VLC.command" +chmod +x "Extras/Audio-Video/VLC.command" + +# Browsers +sed 's#___#"dmg" "Firefox" "Firefox.app" "http://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" "" "" ""#' "install.command" >> "Extras/Browsers/Firefox.command" +chmod +x "Extras/Browsers/Firefox.command" +sed 's#___#"dmg" "Google Chrome" "Google Chrome.app" "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" "" "" ""#' "install.command" >> "Extras/Browsers/Google Chrome.command" +chmod +x "Extras/Browsers/Google Chrome.command" +sed 's#___#"dmg" "Opera" "Opera.app" "http://get.geo.opera.com/pub/opera/desktop/39.0.2256.71/mac/Opera_39.0.2256.71_Setup.dmg" "" "" ""#' "install.command" >> "Extras/Browsers/Opera.command" +chmod +x "Extras/Browsers/Opera.command" + +# Cloud +sed 's#___#"dmg" "Google Drive" "Google Drive.app" "https://dl-ssl.google.com/drive/installgoogledrive.dmg" "" "" ""#' "install.command" >> "Extras/Cloud/Google Drive.command" +chmod +x "Extras/Cloud/Google Drive.command" +sed 's#___#"dmg" "Dropbox" "Dropbox.app" "https://www.dropbox.com/download?plat=mac" "" "" ""#' "install.command" >> "Extras/Cloud/Dropbox.command" +chmod +x "Extras/Cloud/Dropbox.command" +sed 's#___#"dmg" "Evernote" "Evernote.app" "http://evernote.com/download/get.php?file=EvernoteMac" "" "" ""#' "install.command" >> "Extras/Cloud/Evernote.command" +chmod +x "Extras/Cloud/Evernote.command" +sed 's#___#"tar" "FileZilla" "FileZilla.app" "http://downloads.sourceforge.net/project/filezilla/FileZilla_Client/3.21.0/FileZilla_3.21.0_macosx-x86.app.tar.bz2" "" "" ""#' "install.command" >> "Extras/Cloud/FileZilla.command" +chmod +x "Extras/Cloud/FileZilla.command" +sed 's#___#"dmg" "KeePassX" "KeePassX.app" "http://www.keepassx.org/releases/2.0.2/KeePassX-2.0.2.dmg" "" "" ""#' "install.command" >> "Extras/Cloud/KeePassX.command" +chmod +x "Extras/Cloud/KeePassX.command" +sed 's#___#"dmg" "OmniFocus" "OmniFocus.app" "http://www.omnigroup.com/download/latest/omnifocus" "" "" ""#' "install.command" >> "Extras/Cloud/OmniFocus.command" +chmod +x "Extras/Cloud/OmniFocus.command" +sed 's#___#"dmg" "Tunnelblick" "Tunnelblick.app" "https://tunnelblick.net/release/Tunnelblick_3.6.7beta04_build_4601.dmg" "" "" ""#' "install.command" >> "Extras/Cloud/Tunnelblick.command" +chmod +x "Extras/Cloud/Tunnelblick.command" + +# Communication +sed 's#___#"dmg" "Adium" "Adium.app" "https://adiumx.cachefly.net/Adium_1.5.10.2.dmg" "" "" ""#' "install.command" >> "Extras/Communication/Adium.command" +chmod +x "Extras/Communication/Adium.command" +sed 's#___#"dmg" "Skype" "Skype.app" "http://www.skype.com/go/getskype-macosx.dmg" "" "" ""#' "install.command" >> "Extras/Communication/Skype.command" +chmod +x "Extras/Communication/Skype.command" +sed 's#___#"zip" "Slack" "Slack.app" "https://slack.com/ssb/download-osx" "" "" ""#' "install.command" >> "Extras/Communication/Slack.command" +chmod +x "Extras/Communication/Slack.command" + +# Compression +sed 's#___#"dmg" "Keka" "Keka.app" "http://download.kekaosx.com/" "" "" ""#' "install.command" >> "Extras/Compression/Keka.command" +chmod +x "Extras/Compression/Keka.command" +sed 's#___#"dmg" "The Unarchiver" "The Unarchiver.app" "http://unarchiver.c3.cx/downloads/TheUnarchiver3.10.1.dmg" "" "" ""#' "install.command" >> "Extras/Compression/The Unarchiver.command" +chmod +x "Extras/Compression/The Unarchiver.command" +sed 's#___#"zip" "UnRarX" "UnRarX.app" "http://www.unrarx.com/files/UnRarX_2.2.zip" "" "" ""#' "install.command" >> "Extras/Compression/UnRarX.command" +chmod +x "Extras/Compression/UnRarX.command" + +# Image-Photo +sed 's#___#"zip" "Flux" "Flux.app" "https://justgetflux.com/mac/Flux.zip" "" "" "build"#' "install.command" >> "Extras/Image-Photo/Flux.command" +chmod +x "Extras/Image-Photo/Flux.command" +sed 's#___#"dmg" "Inkscape" "Inkscape.app" "https://inkscape.org/en/gallery/item/3896/Inkscape-0.91-1-x11-10.7-x86_64.dmg" "" "" ""#' "install.command" >> "Extras/Image-Photo/Inkscape.command" +chmod +x "Extras/Image-Photo/Inkscape.command" +sed 's#___#"dmg" "GIMP" "GIMP.app" "http://download.gimp.org/mirror/pub/gimp/v2.8/osx/gimp-2.8.18-x86_64.dmg" "" "" ""#' "install.command" >> "Extras/Image-Photo/GIMP.command" +chmod +x "Extras/Image-Photo/GIMP.command" + +# Office +sed 's#___#"dmg" "LibreOffice" "LibreOffice.app" "http://download.documentfoundation.org/libreoffice/stable/5.1.5/mac/x86_64/LibreOffice_5.1.5_MacOS_x86-64.dmg" "" "" ""#' "install.command" >> "Extras/Office/LibreOffice.command" +chmod +x "Extras/Office/LibreOffice.command" +sed 's#___#"dmg" "OpenOffice" "OpenOffice.app" "http://downloads.sourceforge.net/project/openofficeorg.mirror/4.1.2/binaries/en-US/Apache_OpenOffice_4.1.2_MacOS_x86-64_install_en-US.dmg" "" "" ""#' "install.command" >> "Extras/Office/OpenOffice.command" +chmod +x "Extras/Office/OpenOffice.command" +sed 's#___#"dmg" "Thunderbird" "Thunderbird.app" "http://download.mozilla.org/?product=thunderbird-latest&os=osx&lang=en-US" "" "" ""#' "install.command" >> "Extras/Office/Thunderbird.command" +chmod +x "Extras/Office/Thunderbird.command" + +# Security +sed 's#___#"zip" "BitDefender ART" "Adware Removal Tool.app" "http://download.bitdefender.com/mac/tools/Adware%20Removal%20Tool.zip" "" "" ""#' "install.command" >> "Extras/Security/BitDefender ART.command" +chmod +x "Extras/Security/BitDefender ART.command" +sed 's#___#"dmg" "ClamXav" "ClamXav.app" "http://www.clamxav.com/downloads/ClamXav_2.9.2_2478.zip" "" "" ""#' "install.command" >> "Extras/Security/ClamXav.command" +chmod +x "Extras/Security/ClamXav.command" +sed 's#___#"dmg" "Malwarebytes Anti-Malware" "Malwarebytes Anti-Malware.app" "https://store.malwarebytes.org/342/purl-mbamm-dl" "" "" ""#' "install.command" >> "Extras/Security/Malwarebytes Anti-Malware.command" +chmod +x "Extras/Security/Malwarebytes Anti-Malware.command" + +# Misc +sed 's#___#"zip" "Caffeine" "caffeine.app" "http://download.lightheadsw.com/download.php?software=caffeine" "" "" "build"#' "install.command" >> "Extras/Caffeine.command" +chmod +x "Extras/Caffeine.command" +sed 's#___#"dmg" "Calibre" "calibre.app" "http://status.calibre-ebook.com/dist/osx32" "" "" ""#' "install.command" >> "Extras/Calibre.command" +chmod +x "Extras/Calibre.command" +sed 's#___#"zip" "gfxCardStatus" "gfxCardStatus.app" "http://gfx.io/downloads/gfxCardStatus-2.3.zip" "" "" ""#' "install.command" >> "Extras/gfxCardStatus.command" +chmod +x "Extras/gfxCardStatus.command" +sed 's#___#"dmg" "GoogleEarth" "Google Earth.app" "https://dl.google.com/earth/client/advanced/current/GoogleEarthMac-Intel.dmg" "" "" ""#' "install.command" >> "Extras/GoogleEarth.command" +chmod +x "Extras/GoogleEarth.command" +sed 's#___#"zip" "iTerm2" "iTerm.app" "https://iterm2.com/downloads/stable/iTerm2-3_0_9.zip" "" "" ""#' "install.command" >> "Extras/iTerm2.command" +chmod +x "Extras/iTerm2.command" +sed 's#___#"zip" "Macs Fan Control" "Macs Fan Control.app" "http://www.crystalidea.com/downloads/macsfancontrol.zip" "" "" ""#' "install.command" >> "Extras/Macs Fan Control.command" +chmod +x "Extras/Macs Fan Control.command" +sed 's#___#"dmg" "Steam" "Steam.app" "http://media.steampowered.com/client/installer/steam.dmg" "" "" "build"#' "install.command" >> "Extras/Steam.command" +chmod +x "Extras/Steam.command" +sed 's#___#"dmg" "TeamViewerQS" "TeamViewerQS.app" "http://download.teamviewer.com/download/TeamViewerQS.dmg" "" "" ""#' "install.command" >> "Extras/TeamViewerQS.command" +chmod +x "Extras/TeamViewerQS.command" + diff --git a/.bin/_templates/install.command b/.bin/_templates/install.command new file mode 100644 index 00000000..21bdbf95 --- /dev/null +++ b/.bin/_templates/install.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" ___ + +# Done +echo "" diff --git a/.gitignore b/.gitignore index e43b0f98..fcc15219 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .DS_Store +.bin/install_cache diff --git a/SW Diagnostics.command b/Diagnostics.command similarity index 100% rename from SW Diagnostics.command rename to Diagnostics.command diff --git a/Installers/Extras/Audio-Video/HandBrake.command b/Installers/Extras/Audio-Video/HandBrake.command index d2e66524..58fe3b66 100644 --- a/Installers/Extras/Audio-Video/HandBrake.command +++ b/Installers/Extras/Audio-Video/HandBrake.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "HandBrake" "HandBrake.app" "http://downloads.sourceforge.net/project/handbrake/0.10.5/HandBrake-0.10.5-MacOSX.6_GUI_x86_64.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "HandBrake" "HandBrake.app" "http://downloads.sourceforge.net/project/handbrake/0.10.5/HandBrake-0.10.5-MacOSX.6_GUI_x86_64.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Audio-Video/Kodi.command b/Installers/Extras/Audio-Video/Kodi.command new file mode 100644 index 00000000..a9d5132d --- /dev/null +++ b/Installers/Extras/Audio-Video/Kodi.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Kodi" "Kodi.app" "http://mirrors.kodi.tv/releases/osx/x86_64/kodi-16.1-Jarvis-x86_64.dmg" "" "" "" + +# Done +echo "" diff --git a/Installers/Extras/Audio-Video/Plex.command b/Installers/Extras/Audio-Video/Plex.command new file mode 100644 index 00000000..cc7cb53e --- /dev/null +++ b/Installers/Extras/Audio-Video/Plex.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" "zip" "Plex" "Plex Media Server.app" "https://downloads.plex.tv/plex-media-server/0.9.16.6.1993-5089475/PlexMediaServer-0.9.16.6.1993-5089475-OSX.zip" "" "" "" + +# Done +echo "" diff --git a/Installers/Extras/Audio-Video/Spotify.command b/Installers/Extras/Audio-Video/Spotify.command index b5d99d0e..bb438fc5 100644 --- a/Installers/Extras/Audio-Video/Spotify.command +++ b/Installers/Extras/Audio-Video/Spotify.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Spotify" "Spotify.app" "http://download.spotify.com/Spotify.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Spotify" "Spotify.app" "http://download.spotify.com/Spotify.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Audio-Video/VLC.command b/Installers/Extras/Audio-Video/VLC.command index bc53b410..366012d7 100644 --- a/Installers/Extras/Audio-Video/VLC.command +++ b/Installers/Extras/Audio-Video/VLC.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "VLC" "VLC.app" "http://get.videolan.org/vlc/2.2.4/macosx/vlc-2.2.4.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "VLC" "VLC.app" "http://get.videolan.org/vlc/2.2.4/macosx/vlc-2.2.4.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Audio-Video/mpv.command b/Installers/Extras/Audio-Video/mpv.command index 240eefa1..0461182e 100644 --- a/Installers/Extras/Audio-Video/mpv.command +++ b/Installers/Extras/Audio-Video/mpv.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "tar" "mpv" "mpv.app" "http://sva.wakku.to/~chris/mpv_builds/mpv_latest.tar.bz2" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "tar" "mpv" "mpv.app" "http://sva.wakku.to/~chris/mpv_builds/mpv_latest.tar.bz2" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Browsers/Chrome & Firefox.command b/Installers/Extras/Browsers/Chrome & Firefox.command deleted file mode 100644 index 56aabcba..00000000 --- a/Installers/Extras/Browsers/Chrome & Firefox.command +++ /dev/null @@ -1,81 +0,0 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps - -############################### -# Print script header # -############################### -echo $" - - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - - -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} - -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Chrome" "Google Chrome.app" "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" "" "" "" -installApp "dmg" "Firefox" "Firefox.app" "http://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file diff --git a/Installers/Extras/Browsers/Chrome.command b/Installers/Extras/Browsers/Chrome.command deleted file mode 100644 index 1ab304de..00000000 --- a/Installers/Extras/Browsers/Chrome.command +++ /dev/null @@ -1,80 +0,0 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps - -############################### -# Print script header # -############################### -echo $" - - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - - -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} - -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Chrome" "Google Chrome.app" "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file diff --git a/Installers/Extras/Browsers/Firefox.command b/Installers/Extras/Browsers/Firefox.command index 652ec106..1d3c0fe8 100644 --- a/Installers/Extras/Browsers/Firefox.command +++ b/Installers/Extras/Browsers/Firefox.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Firefox" "Firefox.app" "http://download.mozilla.org/?product=firefox-latest___os=osx___lang=en-US" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Firefox" "Firefox.app" "http://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Browsers/Google Chrome.command b/Installers/Extras/Browsers/Google Chrome.command new file mode 100644 index 00000000..01d8b014 --- /dev/null +++ b/Installers/Extras/Browsers/Google Chrome.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Google Chrome" "Google Chrome.app" "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" "" "" "" + +# Done +echo "" diff --git a/Installers/Extras/Browsers/Opera.command b/Installers/Extras/Browsers/Opera.command index 3b03d843..104f6faa 100644 --- a/Installers/Extras/Browsers/Opera.command +++ b/Installers/Extras/Browsers/Opera.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Opera" "Opera.app" "http://get.geo.opera.com/pub/opera/desktop/39.0.2256.71/mac/Opera_39.0.2256.71_Setup.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Opera" "Opera.app" "http://get.geo.opera.com/pub/opera/desktop/38.0.2220.41/mac/Opera_38.0.2220.41_Setup.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Caffeine.command b/Installers/Extras/Caffeine.command index 177ccffc..a28dd462 100644 --- a/Installers/Extras/Caffeine.command +++ b/Installers/Extras/Caffeine.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "zip" "Caffeine" "caffeine.app" "http://download.lightheadsw.com/download.php?software=caffeine" "" "" "build" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "zip" "Caffeine" "caffeine.app" "http://download.lightheadsw.com/download.php?software=caffeine" "" "" "build" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Calibre.command b/Installers/Extras/Calibre.command index e08ccf8f..524a6aa3 100644 --- a/Installers/Extras/Calibre.command +++ b/Installers/Extras/Calibre.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Calibre" "calibre.app" "http://status.calibre-ebook.com/dist/osx32" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Calibre" "calibre.app" "http://status.calibre-ebook.com/dist/osx32" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Cloud/Dropbox.command b/Installers/Extras/Cloud/Dropbox.command index 61cd3454..91e373bf 100644 --- a/Installers/Extras/Cloud/Dropbox.command +++ b/Installers/Extras/Cloud/Dropbox.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Dropbox" "Dropbox.app" "https://www.dropbox.com/download?plat=mac" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Dropbox" "Dropbox.app" "https://www.dropbox.com/download?plat=mac" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Cloud/Evernote.command b/Installers/Extras/Cloud/Evernote.command index 235449e3..d13e4f9f 100644 --- a/Installers/Extras/Cloud/Evernote.command +++ b/Installers/Extras/Cloud/Evernote.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Evernote" "Evernote.app" "http://evernote.com/download/get.php?file=EvernoteMac" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Evernote" "Evernote.app" "http://evernote.com/download/get.php?file=EvernoteMac" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Cloud/FileZilla.command b/Installers/Extras/Cloud/FileZilla.command new file mode 100644 index 00000000..394f631e --- /dev/null +++ b/Installers/Extras/Cloud/FileZilla.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" "tar" "FileZilla" "FileZilla.app" "http://downloads.sourceforge.net/project/filezilla/FileZilla_Client/3.21.0/FileZilla_3.21.0_macosx-x86.app.tar.bz2" "" "" "" + +# Done +echo "" diff --git a/Installers/Extras/Cloud/Google Drive.command b/Installers/Extras/Cloud/Google Drive.command index 419f415c..9b11cff9 100644 --- a/Installers/Extras/Cloud/Google Drive.command +++ b/Installers/Extras/Cloud/Google Drive.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Google Drive" "Google Drive.app" "https://dl-ssl.google.com/drive/installgoogledrive.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Drive" "Google Drive.app" "https://dl-ssl.google.com/drive/installgoogledrive.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Cloud/KeePassX.command b/Installers/Extras/Cloud/KeePassX.command index de8fb9cc..cd848f1b 100644 --- a/Installers/Extras/Cloud/KeePassX.command +++ b/Installers/Extras/Cloud/KeePassX.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "KeePassX" "KeePassX.app" "http://www.keepassx.org/releases/2.0.2/KeePassX-2.0.2.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "KeePassX" "KeePassX.app" "http://www.keepassx.org/releases/2.0.2/KeePassX-2.0.2.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Cloud/OmniFocus.command b/Installers/Extras/Cloud/OmniFocus.command index 50ad2d36..745d1bd8 100644 --- a/Installers/Extras/Cloud/OmniFocus.command +++ b/Installers/Extras/Cloud/OmniFocus.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "OmniFocus" "OmniFocus.app" "http://www.omnigroup.com/download/latest/omnifocus" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "OpenOffice" "OpenOffice.app" "http://downloads.sourceforge.net/project/openofficeorg.mirror/4.1.2/binaries/en-US/Apache_OpenOffice_4.1.2_MacOS_x86-64_install_en-US.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Cloud/Tunnelblick.command b/Installers/Extras/Cloud/Tunnelblick.command index 75283d6a..ca85a482 100644 --- a/Installers/Extras/Cloud/Tunnelblick.command +++ b/Installers/Extras/Cloud/Tunnelblick.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Tunnelblick" "Tunnelblick.app" "https://tunnelblick.net/release/Tunnelblick_3.6.7beta04_build_4601.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Tunnelblick" "Tunnelblick.app" "https://tunnelblick.net/release/Tunnelblick_3.6.2beta02_build_4551.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Communication/Adium.command b/Installers/Extras/Communication/Adium.command index 8c280125..a77fc5bf 100644 --- a/Installers/Extras/Communication/Adium.command +++ b/Installers/Extras/Communication/Adium.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Adium" "Adium.app" "https://adiumx.cachefly.net/Adium_1.5.10.2.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Adium" "Adium.app" "https://adiumx.cachefly.net/Adium_1.5.10.2.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Communication/Skype.command b/Installers/Extras/Communication/Skype.command index c17cc913..92cf86ae 100644 --- a/Installers/Extras/Communication/Skype.command +++ b/Installers/Extras/Communication/Skype.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Skype" "Skype.app" "http://www.skype.com/go/getskype-macosx.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Skype" "Skype.app" "http://www.skype.com/go/getskype-macosx.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Communication/Slack.command b/Installers/Extras/Communication/Slack.command index a58adaff..cfc48c64 100644 --- a/Installers/Extras/Communication/Slack.command +++ b/Installers/Extras/Communication/Slack.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "zip" "Slack" "Slack.app" "https://slack.com/ssb/download-osx" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "zip" "Slack" "Slack.app" "https://slack.com/ssb/download-osx" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Compression/Keka.command b/Installers/Extras/Compression/Keka.command index a21736c6..415e4168 100644 --- a/Installers/Extras/Compression/Keka.command +++ b/Installers/Extras/Compression/Keka.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Keka" "Keka.app" "http://download.kekaosx.com/" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "LibreOffice" "LibreOffice.app" "http://download.documentfoundation.org/libreoffice/stable/5.0.6/mac/x86_64/LibreOffice_5.0.6_MacOS_x86-64.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Compression/The Unarchiver.command b/Installers/Extras/Compression/The Unarchiver.command index 3184f574..881ac847 100644 --- a/Installers/Extras/Compression/The Unarchiver.command +++ b/Installers/Extras/Compression/The Unarchiver.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "The Unarchiver" "The Unarchiver.app" "http://unarchiver.c3.cx/downloads/TheUnarchiver3.10.1.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "The Unarchiver" "The Unarchiver.app" "http://unarchiver.c3.cx/downloads/TheUnarchiver3.10.1.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Compression/UnRarX.command b/Installers/Extras/Compression/UnRarX.command new file mode 100644 index 00000000..04624f59 --- /dev/null +++ b/Installers/Extras/Compression/UnRarX.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" "zip" "UnRarX" "UnRarX.app" "http://www.unrarx.com/files/UnRarX_2.2.zip" "" "" "" + +# Done +echo "" diff --git a/Installers/Extras/DiskMaker X.command b/Installers/Extras/DiskMaker X.command deleted file mode 100644 index 49b21ff9..00000000 --- a/Installers/Extras/DiskMaker X.command +++ /dev/null @@ -1,80 +0,0 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps - -############################### -# Print script header # -############################### -echo $" - - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - - -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} - -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "DiskMaker X 5" "undefined" "http://diskmakerx.com/downloads/DiskMaker_X_503.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file diff --git a/Installers/Extras/FileZilla.command b/Installers/Extras/FileZilla.command deleted file mode 100644 index 8bfeb389..00000000 --- a/Installers/Extras/FileZilla.command +++ /dev/null @@ -1,80 +0,0 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps - -############################### -# Print script header # -############################### -echo $" - - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - - -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} - -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "tar" "FileZilla" "FileZilla.app" "http://downloads.sourceforge.net/project/filezilla/FileZilla_Client/3.19.0/FileZilla_3.19.0_macosx-x86.app.tar.bz2" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file diff --git a/Installers/Extras/Google Earth.command b/Installers/Extras/Google Earth.command deleted file mode 100644 index d44a8c76..00000000 --- a/Installers/Extras/Google Earth.command +++ /dev/null @@ -1,80 +0,0 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps - -############################### -# Print script header # -############################### -echo $" - - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - - -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} - -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Earth" "Google Earth.app" "https://dl.google.com/earth/client/advanced/current/GoogleEarthMac-Intel.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file diff --git a/Installers/Extras/GoogleEarth.command b/Installers/Extras/GoogleEarth.command new file mode 100644 index 00000000..5f5d0685 --- /dev/null +++ b/Installers/Extras/GoogleEarth.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "GoogleEarth" "Google Earth.app" "https://dl.google.com/earth/client/advanced/current/GoogleEarthMac-Intel.dmg" "" "" "" + +# Done +echo "" diff --git a/Installers/Extras/Image-Photo/Flux.command b/Installers/Extras/Image-Photo/Flux.command index c11c8bf6..d0c6a030 100644 --- a/Installers/Extras/Image-Photo/Flux.command +++ b/Installers/Extras/Image-Photo/Flux.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "zip" "Flux" "Flux.app" "https://justgetflux.com/mac/Flux.zip" "" "" "build" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "zip" "Flux" "Flux.app" "https://justgetflux.com/mac/Flux.zip" "" "" "build" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Image-Photo/GIMP.command b/Installers/Extras/Image-Photo/GIMP.command index b343b203..5958cfd2 100644 --- a/Installers/Extras/Image-Photo/GIMP.command +++ b/Installers/Extras/Image-Photo/GIMP.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "GIMP" "GIMP.app" "http://download.gimp.org/mirror/pub/gimp/v2.8/osx/gimp-2.8.18-x86_64.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "GIMP" "GIMP.app" "http://download.gimp.org/mirror/pub/gimp/v2.8/osx/gimp-2.8.16-x86_64-1.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Image-Photo/Inkscape.command b/Installers/Extras/Image-Photo/Inkscape.command index bccfef6c..a1cda882 100644 --- a/Installers/Extras/Image-Photo/Inkscape.command +++ b/Installers/Extras/Image-Photo/Inkscape.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Inkscape" "Inkscape.app" "https://inkscape.org/en/gallery/item/3896/Inkscape-0.91-1-x11-10.7-x86_64.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Inkscape" "Inkscape.app" "https://inkscape.org/en/gallery/item/3896/Inkscape-0.91-1-x11-10.7-x86_64.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Macs Fan Control.command b/Installers/Extras/Macs Fan Control.command new file mode 100644 index 00000000..bf28793e --- /dev/null +++ b/Installers/Extras/Macs Fan Control.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" "zip" "Macs Fan Control" "Macs Fan Control.app" "http://www.crystalidea.com/downloads/macsfancontrol.zip" "" "" "" + +# Done +echo "" diff --git a/Installers/Extras/Office/LibreOffice.command b/Installers/Extras/Office/LibreOffice.command index a21736c6..07951a1f 100644 --- a/Installers/Extras/Office/LibreOffice.command +++ b/Installers/Extras/Office/LibreOffice.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "LibreOffice" "LibreOffice.app" "http://download.documentfoundation.org/libreoffice/stable/5.1.5/mac/x86_64/LibreOffice_5.1.5_MacOS_x86-64.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "LibreOffice" "LibreOffice.app" "http://download.documentfoundation.org/libreoffice/stable/5.0.6/mac/x86_64/LibreOffice_5.0.6_MacOS_x86-64.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Office/OpenOffice.command b/Installers/Extras/Office/OpenOffice.command index 50ad2d36..2cc6ce6a 100644 --- a/Installers/Extras/Office/OpenOffice.command +++ b/Installers/Extras/Office/OpenOffice.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "OpenOffice" "OpenOffice.app" "http://downloads.sourceforge.net/project/openofficeorg.mirror/4.1.2/binaries/en-US/Apache_OpenOffice_4.1.2_MacOS_x86-64_install_en-US.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "OpenOffice" "OpenOffice.app" "http://downloads.sourceforge.net/project/openofficeorg.mirror/4.1.2/binaries/en-US/Apache_OpenOffice_4.1.2_MacOS_x86-64_install_en-US.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Office/Thunderbird.command b/Installers/Extras/Office/Thunderbird.command index e25ad183..8dd1a83f 100644 --- a/Installers/Extras/Office/Thunderbird.command +++ b/Installers/Extras/Office/Thunderbird.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Thunderbird" "Thunderbird.app" "http://download.mozilla.org/?product=thunderbird-latest___os=osx___lang=en-US" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Thunderbird" "Thunderbird.app" "http://download.mozilla.org/?product=thunderbird-latest&os=osx&lang=en-US" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Security/BitDefender ART.command b/Installers/Extras/Security/BitDefender ART.command index 9634beb8..efffc24b 100644 --- a/Installers/Extras/Security/BitDefender ART.command +++ b/Installers/Extras/Security/BitDefender ART.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "zip" "BitDefender ART" "Adware Removal Tool.app" "http://download.bitdefender.com/mac/tools/Adware%20Removal%20Tool.zip" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "zip" "BitDefender ART" "Adware Removal Tool.app" "http://download.bitdefender.com/mac/tools/Adware%20Removal%20Tool.zip" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/Security/ClamXav.command b/Installers/Extras/Security/ClamXav.command new file mode 100644 index 00000000..10650203 --- /dev/null +++ b/Installers/Extras/Security/ClamXav.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "ClamXav" "ClamXav.app" "http://www.clamxav.com/downloads/ClamXav_2.9.2_2478.zip" "" "" "" + +# Done +echo "" diff --git a/Installers/Extras/Security/Malwarebytes Anti-Malware.command b/Installers/Extras/Security/Malwarebytes Anti-Malware.command new file mode 100644 index 00000000..663d934c --- /dev/null +++ b/Installers/Extras/Security/Malwarebytes Anti-Malware.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Malwarebytes Anti-Malware" "Malwarebytes Anti-Malware.app" "https://store.malwarebytes.org/342/purl-mbamm-dl" "" "" "" + +# Done +echo "" diff --git a/Installers/Extras/Security/Malwarebytes.command b/Installers/Extras/Security/Malwarebytes.command deleted file mode 100644 index e0225730..00000000 --- a/Installers/Extras/Security/Malwarebytes.command +++ /dev/null @@ -1,80 +0,0 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps - -############################### -# Print script header # -############################### -echo $" - - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - - -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} - -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Anti-Malware" "Malwarebytes Anti-Malware.app" "https://store.malwarebytes.org/342/purl-mbamm-dl" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file diff --git a/Installers/Extras/Steam.command b/Installers/Extras/Steam.command index 82c7b2e5..0cee1d60 100644 --- a/Installers/Extras/Steam.command +++ b/Installers/Extras/Steam.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Steam" "Steam.app" "http://media.steampowered.com/client/installer/steam.dmg" "" "" "build" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Steam" "Steam.app" "http://media.steampowered.com/client/installer/steam.dmg" "" "" "build" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/TeamViewerQS.command b/Installers/Extras/TeamViewerQS.command index 0bb04c91..0dd1b273 100644 --- a/Installers/Extras/TeamViewerQS.command +++ b/Installers/Extras/TeamViewerQS.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "TeamViewerQS" "TeamViewerQS.app" "http://download.teamviewer.com/download/TeamViewerQS.dmg" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "TeamViewerQS" "TeamViewerQS.app" "http://download.teamviewer.com/download/TeamViewerQS.dmg" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/Extras/gfxCardStatus.command b/Installers/Extras/gfxCardStatus.command new file mode 100644 index 00000000..db3abc83 --- /dev/null +++ b/Installers/Extras/gfxCardStatus.command @@ -0,0 +1,27 @@ +#!/bin/bash + +# Init +BIN="" +clear + +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi + +# Install App(s) +"$BIN/Scripts/install_app" "zip" "gfxCardStatus" "gfxCardStatus.app" "http://gfx.io/downloads/gfxCardStatus-2.3.zip" "" "" "" + +# Done +echo "" diff --git a/Installers/Extras/iTerm2.command b/Installers/Extras/iTerm2.command index 9c83bb0f..f9e41eb0 100644 --- a/Installers/Extras/iTerm2.command +++ b/Installers/Extras/iTerm2.command @@ -1,80 +1,27 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "zip" "iTerm2" "iTerm.app" "https://iterm2.com/downloads/stable/iTerm2-3_0_9.zip" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "zip" "iTerm2" "iTerm.app" "https://iterm2.com/downloads/stable/iTerm2-3_0_4.zip" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo "" diff --git a/Installers/OS X.command b/Installers/OS X.command index 8ba1beff..a808d0c9 100644 --- a/Installers/OS X.command +++ b/Installers/OS X.command @@ -1,87 +1,34 @@ -#/bin/bash -clear && rm -rf ~/.macapps && mkdir ~/.macapps > /dev/null && cd ~/.macapps +#!/bin/bash -############################### -# Print script header # -############################### -echo $" +# Init +BIN="" +clear - ███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ - ████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ - ██╔████╔██║███████║██║ ███████║██████╔╝██████╔╝███████╗ - ██║╚██╔╝██║██╔══██║██║ ██╔══██║██╔═══╝ ██╔═══╝ ╚════██║ - ██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║ ██║ ███████║╔═════════╗ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═ .link ═╝\n" - +# Find BIN path +pushd . > /dev/null +cd "$(dirname "$0")" +while [ "$(pwd)" != "/" ]; do + if [ -d ".bin" ]; then + BIN="$(pwd)/.bin" + break + fi + cd .. +done +popd > /dev/null +if [ "$BIN" == "" ]; then + echo ".bin not found" + exit 1 +fi -############################### -# Define worker functions # -############################### -versionChecker() { - local v1=$1; local v2=$2; - while [ `echo $v1 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v1 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v1=`echo $v1 | sed "s/$char/.$char_dec/g"`; done - while [ `echo $v2 | egrep -c [^0123456789.]` -gt 0 ]; do - char=`echo $v2 | sed 's/.*\([^0123456789.]\).*/\1/'`; char_dec=`echo -n "$char" | od -b | head -1 | awk {'print $2'}`; v2=`echo $v2 | sed "s/$char/.$char_dec/g"`; done - v1=`echo $v1 | sed 's/\.\./.0/g'`; v2=`echo $v2 | sed 's/\.\./.0/g'`; - checkVersion "$v1" "$v2" -} +# Install App(s) +"$BIN/Scripts/install_app" "dmg" "Firefox" "Firefox.app" "http://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" "" "" "" +"$BIN/Scripts/install_app" "dmg" "Chrome" "Google Chrome.app" "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" "" "" "" +"$BIN/Scripts/install_app" "dmg" "MBAM" "Malwarebytes Anti-Malware.app" "https://store.malwarebytes.org/342/purl-mbamm-dl" "" "" "" +"$BIN/Scripts/install_app" "zip" "iTerm2" "iTerm.app" "https://iterm2.com/downloads/stable/iTerm2-3_0_9.zip" "" "" "" +"$BIN/Scripts/install_app" "zip" "macsfancontrol" "Macs Fan Control.app" "http://www.crystalidea.com/downloads/macsfancontrol.zip" "" "" "" +"$BIN/Scripts/install_app" "dmg" "Spotify" "Spotify.app" "http://download.spotify.com/Spotify.dmg" "" "" "" +"$BIN/Scripts/install_app" "dmg" "VLC" "VLC.app" "http://get.videolan.org/vlc/2.2.4/macosx/vlc-2.2.4.dmg" "" "" "" +"$BIN/Scripts/install_app" "tgz" "mpv" "mpv.app" "https://laboratory.stolendata.net/~djinn/mpv_osx/mpv-latest.tar.gz" "" "" "" -checkVersion() { - [ "$1" == "$2" ] && return 1 - v1f=`echo $1 | cut -d "." -f -1`;v1b=`echo $1 | cut -d "." -f 2-`;v2f=`echo $2 | cut -d "." -f -1`;v2b=`echo $2 | cut -d "." -f 2-`; - if [[ "$v1f" != "$1" ]] || [[ "$v2f" != "$2" ]]; then [[ "$v1f" -gt "$v2f" ]] && return 1; [[ "$v1f" -lt "$v2f" ]] && return 0; - [[ "$v1f" == "$1" ]] || [[ -z "$v1b" ]] && v1b=0; [[ "$v2f" == "$2" ]] || [[ -z "$v2b" ]] && v2b=0; checkVersion "$v1b" "$v2b"; return $? - else [ "$1" -gt "$2" ] && return 1 || return 0; fi -} - -appStatus() { - if [ ! -d "/Applications/$1" ]; then echo "uninstalled"; else - if [[ $5 == "build" ]]; then BUNDLE="CFBundleVersion"; else BUNDLE="CFBundleShortVersionString"; fi - INSTALLED=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Applications/$1/Contents/Info.plist"` - if [ $4 == "dmg" ]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "/Volumes/$2/$1/Contents/Info.plist"`; - elif [[ $4 == "zip" || $4 == "tar" ]]; then COMPARETO=`/usr/libexec/plistbuddy -c Print:$BUNDLE: "$3$1/Contents/Info.plist"`; fi - checkVersion "$INSTALLED" "$COMPARETO"; UPDATED=$?; - if [[ $UPDATED == 1 ]]; then echo "updated"; else echo "outdated"; fi; fi -} -installApp() { - echo $'\360\237\214\200 - ['$2'] Downloading app...' - if [ $1 == "dmg" ]; then curl -s -L -o "$2.dmg" $4; yes | hdiutil mount -nobrowse "$2.dmg" -mountpoint "/Volumes/$2" > /dev/null; - if [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "/Volumes/$2/$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "$2" "" "dmg" "$7") == "uninstalled" ]]; then cp -R "/Volumes/$2/$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - hdiutil unmount "/Volumes/$2" > /dev/null && rm "$2.dmg" - elif [ $1 == "zip" ]; then curl -s -L -o "$2.zip" $4; unzip -qq "$2.zip"; - if [[ $(appStatus "$3" "" "$5" "zip" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$5$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "zip" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi; - rm -rf "$2.zip" && rm -rf "$5" && rm -rf "$3" - elif [ $1 == "tar" ]; then curl -s -L -o "$2.tar.bz2" $4; tar -zxf "$2.tar.bz2" > /dev/null; - if [[ $(appStatus "$3" "" "$5" "tar" "$7") == "updated" ]]; then echo $'\342\235\214 - ['$2'] Skipped because it was already up to date!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 != "noupdate" ]]; then ditto "$3" "/Applications/$3"; echo $'\360\237\214\216 - ['$2'] Successfully updated!\n'; - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "outdated" && $6 == "noupdate" ]]; then echo $'\342\235\214 - ['$2'] This app cant be updated!\n' - elif [[ $(appStatus "$3" "" "$5" "tar" "$7") == "uninstalled" ]]; then mv "$5$3" /Applications; echo $'\360\237\221\215 - ['$2'] Succesfully installed!\n'; fi - rm -rf "$2.tar.bz2" && rm -rf "$3"; fi -} - -############################### -# Install selected apps # -############################### -installApp "dmg" "Firefox" "Firefox.app" "http://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" "" "" "" -installApp "dmg" "Chrome" "Google Chrome.app" "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" "" "" "" -installApp "zip" "iTerm2" "iTerm.app" "https://iterm2.com/downloads/stable/iTerm2-3_0_4.zip" "" "" "" -installApp "dmg" "The Unarchiver" "The Unarchiver.app" "http://unarchiver.c3.cx/downloads/TheUnarchiver3.10.1.dmg" "" "" "" -installApp "dmg" "Anti-Malware" "Malwarebytes Anti-Malware.app" "https://store.malwarebytes.org/342/purl-mbamm-dl" "" "" "" -installApp "dmg" "Spotify" "Spotify.app" "http://download.spotify.com/Spotify.dmg" "" "" "" -installApp "dmg" "VLC" "VLC.app" "http://get.videolan.org/vlc/2.2.4/macosx/vlc-2.2.4.dmg" "" "" "" -installApp "tar" "mpv" "mpv.app" "http://sva.wakku.to/~chris/mpv_builds/mpv_latest.tar.bz2" "" "" "" - -############################### -# Print script footer # -############################### -echo $'------------------------------------------------------------------------------' -echo $'\360\237\222\254 - Thank you for using macapps.link! Liked it? Recommend us to your friends!' -echo $'------------------------------------------------------------------------------\n' -rm -rf ~/.macapps \ No newline at end of file +# Done +echo ""