aboutsummaryrefslogtreecommitdiffstats
path: root/Low Battery Yup/DaemonLauncher.m
diff options
context:
space:
mode:
Diffstat (limited to 'Low Battery Yup/DaemonLauncher.m')
-rw-r--r--Low Battery Yup/DaemonLauncher.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/Low Battery Yup/DaemonLauncher.m b/Low Battery Yup/DaemonLauncher.m
index 355e9fd..b96af44 100644
--- a/Low Battery Yup/DaemonLauncher.m
+++ b/Low Battery Yup/DaemonLauncher.m
@@ -12,6 +12,10 @@
- (BOOL)launch
{
+ if ([self isRunning]) {
+ return NO;
+ }
+
NSURL *daemon_url = [[NSBundle mainBundle] URLForResource:@"Low Battery Yup.d" withExtension:@"app"];
NSError *error = nil;
@@ -31,6 +35,10 @@
- (BOOL)quit
{
+ if (![self isRunning]) {
+ return NO;
+ }
+
NSArray *applications = [NSRunningApplication
runningApplicationsWithBundleIdentifier:@"com.teddywing.Low-Battery-Yup-d"];