-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun_me_to_verify_install.sh
executable file
·110 lines (91 loc) · 3.95 KB
/
run_me_to_verify_install.sh
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/sh
my_dir="`dirname \"$0\"`"
cd "$my_dir"
if [ $? -ne 0 ] ; then
echo "Could not cd to $my_dir" >&2
exit 5
fi
if [ ! -f $my_dir/XCAB.settings ] ; then
echo "ERROR: $my_dir/XCAB.settings file not found." >&2
echo " Please copy $my_dir/XCAB.settings.sample to $my_dir/XCAB.settings" >&2
echo " and edit it for your environment." >&2
exit 4
fi
. $my_dir/XCAB.settings
. $my_dir/functions.sh
EXIT_STATUS=0
if [ "$ERROR_EMAIL" == "[email protected]" ] ; then
echo "ERROR: Please set ERROR_EMAIL in $my_dir/XCAB.settings to a valid value" >&2
EXIT_STATUS=`expr $EXIT_STATUS + 1`
fi
if [ "$SUCCESS_EMAIL" == "[email protected]" ] ; then
echo "ERROR: Please set SUCCESS_EMAIL in $my_dir/XCAB.settings to a valid value" >&2
EXIT_STATUS=`expr $EXIT_STATUS + 1`
fi
if [ "$BOXCAR_EMAIL" == "[email protected]" ] ; then
echo "ERROR: Please set BOXCAR_EMAIL in $my_dir/XCAB.settings to a valid value" >&2
echo " install the Boxcar App on your iOS device with pushes allowed" >&2
echo " and set up your Boxcar account with Growl/API enabled" >&2
EXIT_STATUS=`expr $EXIT_STATUS + 1`
fi
if [ "$BOXCAR_PASSWORD" == "YOUR_BOXCAR_PASSWORD_GOES_HERE" ] ; then
echo "ERROR: Please set BOXCAR_PASSWORD in $my_dir/XCAB.settings to a valid value" >&2
echo " install the Boxcar App on your iOS device with pushes allowed" >&2
echo " and set up your Boxcar account with Growl/API enabled" >&2
EXIT_STATUS=`expr $EXIT_STATUS + 1`
fi
if [ "$PUBLIC_URL_PREFIX" == "http://dl.dropbox.com/u/YOUR_DROPBOX_ID_GOES_HERE" ] ; then
echo "ERROR: Please set PUBLIC_URL_PREFIX in $my_dir/XCAB.settings to a valid value" >&2
EXIT_STATUS=`expr $EXIT_STATUS + 1`
fi
if [ x"$CODESIGNING_KEYCHAIN_PASSWORD" == "xYOUR_CODESIGNING_PASSWORD_GOES_HERE" ] ; then
echo "ERROR: Please set CODESIGNING_KEYCHAIN_PASSWORD in $my_dir/XCAB.settings to a valid value" >&2
EXIT_STATUS=`expr $EXIT_STATUS + 1`
fi
if [ ! -d "$DROPBOX_HOME" ] ; then
echo "ERROR: Cannot find Dropbox directory. Please set the DROPBOX_HOME variable to the correct value" >&2
EXIT_STATUS=`expr $EXIT_STATUS + 1`
fi
BETA_BUILDER_PATH="`which betabuilder`"
if [ -z "$BETA_BUILDER_PATH" -o ! -x "$BETA_BUILDER_PATH" ] ; then
echo "ERROR: Cannot find betabuilder in PATH" >&2
echo " Get git://github.com/sgruby/iOS-BetaBuilder.git" >&2
echo " and compile and install it" >&2
EXIT_STATUS=`expr $EXIT_STATUS + 1`
fi
if [ ! -d "$XCAB_HOME" ] ; then
echo "Making Directory $XCAB_HOME"
mkdir -p $XCAB_HOME
fi
if [ "$EXIT_STATUS" -eq 0 ] ; then
#Only set this file if everything else is okay
if [ ! -f "$DROPBOX_HOME/.com.PDAgent.XCAB.settings" ] ; then
echo "Making $DROPBOX_HOME/.com.PDAgent.XCAB.settings file so iOS app can find the right directory"
echo "$XCAB_DROPBOX_PATH" > "$DROPBOX_HOME/.com.PDAgent.XCAB.settings"
fi
if [ "`cat $DROPBOX_HOME/.com.PDAgent.XCAB.settings`" != "$XCAB_DROPBOX_PATH" ] ; then
echo "Correcting $DROPBOX_HOME/.com.PDAgent.XCAB.settings file so iOS app can find the right directory"
echo "$XCAB_DROPBOX_PATH" > "$DROPBOX_HOME/.com.PDAgent.XCAB.settings"
fi
if [ ! -f "$XCAB_CONF" ] ; then
echo "# This is the config file for XCAB" > "$XCAB_CONF"
echo "# Lines that start with hashes(#) are comments" >> "$XCAB_CONF"
echo "# Add lines to this file of the form:" >> "$XCAB_CONF"
echo "# DIRECTORY=protocol://path/to/git/repo" >> "$XCAB_CONF"
echo "# For example:" >> "$XCAB_CONF"
echo "# XCAB=git://github.com/carlbrown/XCAB.git" >> "$XCAB_CONF"
fi
fi
if [ ! -z "$CODESIGNING_KEYCHAIN" -a -f "$CODESIGNING_KEYCHAIN" -a ! -z "$CODESIGNING_KEYCHAIN_PASSWORD" ] ; then
if [ "$EXIT_STATUS" -eq 0 ] ; then
echo "You should be good to go. Please put the following line in your crontab to start the script:"
echo "* * * * * $my_dir/run_from_cron.sh"
fi
else
if [ "$EXIT_STATUS" -eq 0 ] ; then
echo "You are set up to run, as long as you stay logged in. You can run:"
echo "$my_dir/run_in_terminal.sh"
echo "in a termnial window"
fi
fi
exit $EXIT_STATUS