Advertisement
s243a

ff (2) (start seamonkey)

Apr 18th, 2019
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.20 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. #LAUNCHDIR="$(cd "$(dirname "$0")"; pwd)"
  4. LAUNCHDIR=$(dirname "$(readlink -f "$0")")
  5.  
  6.  
  7. set_FF_ARGS(){
  8.    FF_ARGS=()
  9.    #ssdo_pos_arg_count=0
  10.    #ssdo_arg_count=0
  11.    i=1
  12.    has_profile=0
  13.    while [ $i -le $# ]; do
  14.    case "${@:$i:1}" in
  15.    -p=*|-profile=*)
  16.       arg="${@:$i:1}"; opt="${val%%=*}"; val="${val#*=}"
  17.       FF_ARGS+=( "$opt" "$val" );
  18.       if [ "${val%%=*}" = "-profile" ]; then
  19.         profile_dir="${val#*=}"
  20.         has_profile=1
  21.       fi; ;;
  22.    -p|-profile)
  23.      
  24.       opt="${@:$i:1}"
  25.       FF_ARGS+=( "$opt" )
  26.       let "i++" #https://askubuntu.com/questions/385528/how-to-increment-a-variable-in-bash
  27.       val="${@:$i:1}"
  28.       if [ "$opt" = "-profile" ]; then
  29.         profile_dir="$val"  
  30.         has_profile=1
  31.       fi  
  32.       FF_ARGS+=( "$val" ); ;;
  33.    *)
  34.       FF_ARGS+=( "${@:$i:1}" )
  35.       ;;
  36.    esac
  37.       let "i++"
  38.    done
  39.    if [ $has_profile -eq 0 ]; then
  40.      FF_ARGS+=( "-profile" "$LAUNCHDIR/profile" )
  41.      profile_dir="$LAUNCHDIR/profile"
  42.    fi
  43. }  
  44.  
  45. set_FF_ARGS "$@"
  46. mkdir -p "$profile_dir" #2> /dev/null
  47. LD_LIBRARY_PATH=$LAUNCHDIR/:$LAUNCHDIR/extralibs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} "$LAUNCHDIR/seamonkey" "${FF_ARGS[@]}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement