2157
by Quentin PÂRIS
Bash environement for non linux systems |
1 |
#!/usr/bin/env bash
|
1
by Quentin Pâris
first commit |
2 |
|
3 |
# Copyright (C) 2007-2011 Pâris Quentin
|
|
4 |
# Copyright (C) 2007-2010 PlayOnLinux Team
|
|
5 |
||
6 |
# This program is free software; you can redistribute it and/or modify
|
|
7 |
# it under the terms of the GNU General Public License as published by
|
|
8 |
# the Free Software Foundation; either version 2 of the License, or
|
|
9 |
# (at your option) any later version.
|
|
10 |
||
11 |
# This program is distributed in the hope that it will be useful,
|
|
12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 |
# GNU General Public License for more details.
|
|
15 |
||
16 |
# You should have received a copy of the GNU General Public License along
|
|
17 |
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
18 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
19 |
||
20 |
[ "$(uname -s)" = "Darwin" ] && export POL_OS="Mac" |
|
21 |
[ "$(uname -s)" = "Linux" ] && export POL_OS="Linux" |
|
2541
by Pierre Etchemaite
Add online --help to command line tools |
22 |
[ "$(uname -s)" = "FreeBSD" ] && export POL_OS="FreeBSD" |
23 |
||
24 |
usage() { |
|
25 |
local self="$(basename "$0")" |
|
26 |
echo "Usage: $self <URL>" |
|
27 |
echo " $self [-h] [--help]" |
|
28 |
echo "" |
|
29 |
echo "Download and execute a PlayOn{Linux,Mac,FreeBSD} script" |
|
30 |
}
|
|
31 |
||
32 |
if [ "$1" = "" -o "$1" = "-h" -o "$1" = "--help" ] |
|
33 |
then
|
|
34 |
usage |
|
35 |
exit
|
|
36 |
fi
|
|
1
by Quentin Pâris
first commit |
37 |
|
38 |
export SILENT="TRUE" |
|
39 |
if [ "$PLAYONLINUX" = "" ] |
|
40 |
then
|
|
1251
by Quentin Pâris
playonlinux-pkg and playonlinux-url-handler |
41 |
export WorkingDirectory="$PWD" |
1
by Quentin Pâris
first commit |
42 |
CURDIR=`dirname "$0"` |
43 |
cd "$CURDIR" |
|
44 |
CURDIR="$(pwd)" |
|
183
by Quentin Pâris
export MACHTYPE |
45 |
export MACHTYPE
|
1251
by Quentin Pâris
playonlinux-pkg and playonlinux-url-handler |
46 |
cd "$WorkingDirectory" |
2596
by Pierre Etchemaite
Processes usage optimizations |
47 |
exec python "$CURDIR/python/wrapper.py" "$CURDIR/bash/$(basename "$0")" "$@" |
1
by Quentin Pâris
first commit |
48 |
else
|
2596
by Pierre Etchemaite
Processes usage optimizations |
49 |
exec bash "$PLAYONLINUX/bash/$(basename "$0")" "$@" |
1
by Quentin Pâris
first commit |
50 |
fi
|