alexscott


dirigeant

11650 messages

Dirigeant, Membre, Developpeur, LAN-MASTER, Streamer, Adjoint (ED)

Jeudi 16 Juin 2011 - 02:56 (post édité 1 fois)

Voici les scripts que j'utilise. Ils sont bien sur à adapter dans la partie du début qui est la configuration finalement.

 

mc_save.sh a écrit :

#!/bin/sh

 

set -e

LIBRARY_PATH="${HOME}/Library/Application Support/minecraft/saves"

SAVE_PATH="${HOME}/minecraft_saves/"

SAVE_PREFIX=$(date +"%Y%m%d%H%M%s")

 

[ -d "${LIBRARY_PATH}" ] || {

  echo "Configure library path into header's script"

  exit 1

}

 

[ -d "${SAVE_PATH}" ] || {

  echo "Configure save path into header's script"

  exit 1

}

 

cd "${LIBRARY_PATH}"

 

echo "Let's go..."

 

tar -czvf "${SAVE_PATH}/${SAVE_PREFIX}.tar.gz" .

 

echo "Done."

 

mc_switch.sh a écrit :

#!/bin/sh

 

set -e

shopt -s extglob

 

LIBRARY_PATH="${HOME}/Library/Application Support/minecraft/saves"

SAVE_PATH="${HOME}/minecraft_saves/"

CURRENT_VERSION="201106132218_library.tar.gz"

OLD_VERSION="minecraft_1_5_0_2_library.tar.gz"

MINECRAFT_JAR="Library/Application Support/minecraft/bin/minecraft.jar"

 

[ -d "${LIBRARY_PATH}" ] || {

  echo "Configure library path into header's script"

  exit 1

}

 

[ -d "${SAVE_PATH}" ] || {

  echo "configure save path into header's script"

  exit 1

}

 

[ -f "${SAVE_PATH}/${CURRENT_VERSION}" ] || {

  echo "configure current version into header's script"

  exit 1

}

 

[ -f "${SAVE_PATH}/${OLD_VERSION}" ] || {

  echo "configure old version into header's script"

  exit 1

}

 

[ -z "${1}" -o -n "${1/+(old|new)}" ] && {

  echo "Usage: $0 [old|new]"

  exit 1

}

 

echo "Let's go to $1 version ..."

 

cd ~

 

case $1 in

  old) CHOICE=${OLD_VERSION} ;;

  new) CHOICE=${CURRENT_VERSION} ;;

esac

 

tar -xzf "${SAVE_PATH}/${CHOICE}" "${MINECRAFT_JAR}"

 

echo "Done."


Que le citron soit pressé ou qu'il vente, il jute.

alexscott


dirigeant

11650 messages

Dirigeant, Membre, Developpeur, LAN-MASTER, Streamer, Adjoint (ED)

Jeudi 16 Juin 2011 - 12:52

parce que c'est la classe en couleur et que vim le fait super bien :

#!/bin/sh
LIBRARY_PATH="${HOME}/Library/Application Support/minecraft/saves"
SAVE_PATH="${HOME}/minecraft_saves/"
SAVE_PREFIX=$(date +"%Y%m%d%H%M%s")

[ -d "${LIBRARY_PATH}" ] || {
  echo "Configure library path into header's script"
  exit 1
}

[ -d "${SAVE_PATH}" ] || {
  echo "Configure save path into header's script"
  exit 1
}

cd "${LIBRARY_PATH}"

echo "Let's go..."

tar -czvf "${SAVE_PATH}/${SAVE_PREFIX}.tar.gz" .

echo "Done."

En fait ca fonctionne pas ... je peux pas mettre de balises style Triste


Que le citron soit pressé ou qu'il vente, il jute.

Liens utiles : Rechercher - Droits d'accès