Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Linux Rockz
|
Posted - 2009.04.26 18:59:00 -
[1]
Just a little script to make patching a little easier. I have tried to make it luser friendly. Remember, if it breaks something you get to keep all the pieces.
#!/bin/bash # Version 1.0 # April 25, 2009 # Released under the GPL License- http://www.fsf.org/licensing/licenses/gpl.txt # # Run this script from a terminal window in X. # Remember to set your username and chmod +x the script file you create. # Proxy settings are your resposibility. # Do the upgrade via the EVE client, which will fail. # This will populate the cache dir with the patch file info that we can parse. # Run this script # USER="YOURUSERNAME" EVEPATCHDIR="/home/${USER}/.wine/drive_c/windows/profiles/${USER}/Local Settings/Application Data/CCP/EVE/c_program_files_ccp_eve_tranquility/cache/"
cd /home/${USER}
if [ ! -e "${EVEPATCHDIR}" ] then echo "Please set the correct cache directory" exit 1 fi
if [ "${1}" == "clean" ] then echo "Cleaning up old failed patch files" cd "${EVEPATCHDIR}" PATCHFILECHK=`ls *premiumpatch*` clear if [ "${PATCHFILECHK}" = "" ] then echo "No Patch Files Found. Start EVE and fail the patch and run \"$0\"!" cd /home/${USER} touch /home/${USER}/.PatchEVE_FirstRun exit 0 else for i in `ls *premiumpatch*`; do echo "Deleting ${i}" && rm -f ${i}; done cd /home/${USER} touch /home/${USER}/.PatchEVE_FirstRun echo "Removed Old Patch Files. Start EVE and fail the patch and run \"$0\"!" exit 0 fi else if [ ! -f "/home/${USER}/.PatchEVE_FirstRun" ] then echo "Please run \"$0 clean\" first. Then start EVE and fail the patch before running this script again!" exit 1 fi
fi
EVEPATCH=`ls "${EVEPATCHDIR}"| grep premiumpatch` if [ "${EVEPATCH}" == "" ] then echo "No patchfile found in the cache directory. Please run EVE and \"FAIL\" the patch process. Then rerun ${0}" exit 1 fi
NEWPATCHNAME=${EVEPATCH%%.*}_m.exe
echo " Downloading ${NEWPATCHNAME}" echo ""
wget http://ccp.vo.llnwd.net/o2/${NEWPATCHNAME} OLDFILE=${EVEPATCHDIR}${EVEPATCH} echo "Removing ${OLDFILE}" rm -f "${OLDFILE}" WINEPREFIX="/home/${USER}/.wine" wine ${NEWPATCHNAME} echo "Removing ${NEWPATCHNAME}" rm -f "${OLDFILE}" echo "Done Patching EVE ! "
|
Ravow
Minmatar Cosmic Encounter
|
Posted - 2009.04.27 17:08:00 -
[2]
You can remplace the $USER thing by ~!
cd ~ = cd /home/the_user_that_typed_the_cd_command
|
Whitehound
|
Posted - 2009.04.28 02:14:00 -
[3]
Some tipps for your script:
- $USER gets set by bash automatically. - Use "-d" instead of "-e" for directories. - Use pushd and popd over cd when possible. - Use fgrep over grep when it is a fixed string.
-- If there is anything in your life you fear of losing, then keep your mouth shut once in a while. |
Rakshasa Taisab
Caldari Sane Industries Inc. United Freemen Alliance
|
Posted - 2009.04.28 03:35:00 -
[4]
Originally by: Ravow You can remplace the $USER thing by ~!
cd ~ = cd /home/the_user_that_typed_the_cd_command
No, you generally shouldn't use '~' in scripts, but rather use $HOME.
|
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |