ubuntuusers.de

App Runner

Autor:
Geier
Datum:
19. Mai 2009 17:00
Code:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
echo "App Runner - hacktolive.org/runner"
echo

#get the directory (location) of the file
PATH_OF_FILE="$@"
PROPER_DIRECTORY=$(dirname "$PATH_OF_FILE")
FILE_NAME=$(basename "$PATH_OF_FILE")

#change into de directory of the file
cd "$PROPER_DIRECTORY"

#make file executable
chmod a+x ./"$FILE_NAME"

echo "Preparing to launch "$FILE_NAME"..."
echo
echo "Do not close this window!"
echo

#Run the file
./"$FILE_NAME"

#Final message
echo
echo
echo
echo
echo "App Runner has finished... you can now close this window."
read