-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMac-BionicRestorer.command
executable file
·66 lines (59 loc) · 1.56 KB
/
Mac-BionicRestorer.command
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
#
# .command file for clicky Mac goodness
# 1.0 - 2011-Oct-10 - crpeck
# 1.1 - 2011-Oct-27 - fixed folder with a space in the name issue
#
macprogname=`basename $0`
realscript="BionicRestorer.sh"
macclickversion="1.1"
# parse the directory we're run from - this was the tricky part, without it clicky fails
mydir=`dirname "$BASH_SOURCE"`
# name of script to run
myscript="$mydir/$realscript"
# some extensive error checking and logging info
if [ ! -x $myscript ]; then
echo ""
echo "Error trying to run $myscript"
echo ""
echo "If you post online for help, please include everything printed out here."
echo ""
echo "Debugging Information from $0"
echo " [ -x $myscript failed ] "
echo ""
echo "MacClick: $macprogname"
echo "Macscript Rev: $macclickversion"
echo "BASH_SOURCE: $BASH_SOURCE"
echo "mydir: $mydir"
echo "myscript: $myscript"
echo "Current Directory: $PWD"
echo ""
echo "Contents of directory $mydir:"
ls -l "$mydir"
echo ""
echo "OS Information:"
uname -a
echo ""
read -p "Press Enter to close his window, copy all that stuff down first."
exit 1
fi
### Actually run the script to do our thing pass it the directory to run in
/bin/bash --norc --noprofile "$myscript" "$mydir"
if [ $? -ne 0 ]; then
echo ""
echo "Debugging Information from $0"
echo "Error executing:"
echo " $myscript $mydir"
echo ""
echo "BASH_SOURCE: $BASH_SOURCE"
echo ""
uname -a
echo ""
read -p " Press Enter to close this window."
exit 1
fi
echo ""
echo ""
read -p "Finished - Press Enter to close this window."
exit 0
#eof