Lumaqq startup script

xiaoxiao2021-03-06  94

LUMAQQ starts script #! / Bin / bash # Judging the type of execution file, if it is a symbolic link, get the destination path of this link, in the previous version, this task is done with the # readlink -f command. This method is slightly problematic. For example, there may be no readlink command in your system, or low version # readlink does not support -f parameters, so you will use ReadLink first, if ReadLink fails, then use file command and one # mode Match to get the destination path. At present, I am not sure if the file command on each flat linux page is returning to symbolic link to this string, # 如果 如果 = = [-L "as the Symbolic Link To replace it with your file command $ 0 "]; then prefix =` readlink -f $ 0` i [$? -Eq 0]; the prefix = `Dirname $ prefix` Else prefix =` file $ 0` prefix = $ {prefix ## * symbolic link to} prefix = `DIRNAME $ prefix` Fi Else prefix =` Dirname $ 0` Fi # Here I judge whether the resulting path is an absolute path, if not an absolute # path, I have to do some processing get absolute path Case $ prefix in / *) ;; *) CD $ prefix prefix = `pwd` ;; esac # here check if there is .lumaqq directory in your user directory, if not, # will automatically create one, all of the user's QQ related information will be saved in this # directory Next, on the machine's machine, you should set this directory # 成 You can read if [! -E $ home / .lumaqq]; the mkdir $ homen / .lumaqq Fi # here for some directories for Lumaqq and Documents do some links, this place uses # 了 -f parameters, so even if you move the directory of lumaqq to another place # Next time does not affected CD $ home / .lumaqq ln -sf $ prefix / log4j.properties $ Homen / .lumaqq / log4j.properties ln -sf $ prefix / xml ln -sf $ prefix / sound.dat $ home / .lumaqq / qqwry.dat # here I set Java to class path, LUMAQQ Installation Directory below Lib Directory contains all JAR files that need to be used, these must be added to CP = for i in $ prefix / lib / *. Jar; do cp = $ i: $ cp done # Here is to start running. For the convenience of the user, three cases here, first check that the user is installed is not using the JRE version, if you are #, use the itself. If you fail, check if java_home is set, if set, use java_home, if you still fail, #, find a available JRE below / usr.

转载请注明原文地址:https://www.9cbs.com/read-104781.html

New Post(0)