#!/bin/bash
SETUP_DIR=setup2

help () {
	echo "versi 210819
	Usage: $0 [setup_folder]
	 setup_folder:= tempat menyimpan file-file untuk instalasi
	  default='$SETUP_DIR'"
	exit 1
}

[[ $# && ${1:0:2} == "-h" ]] && help
[ $BASH ] || { echo "
	Harus menggunakan bash!
	"; exit 100
	}

SETUP_DIR=${1:-$SETUP_DIR}
#[ -d $SETUP_DIR ] || mkdir -p $SETUP_DIR
#wget -c -r -N -L https://ksystem.co/downloads/setup2/

rsync --version || sudo apt-get install rsync
rsync -avz --del --exclude partial $OPTS www.ksystem.co::setup2/ ${SETUP_DIR} || {
  echo "
  GAGAL! Lihat pesan kesalahan di atas!
  "
  exit 2
}

set -x
${SETUP_DIR}/setup
