Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Linux: Check for crontab line inserted on delay.set().

  • Loading branch information...
commit 502b59678a2b656e2fdc433eec1d9a602ecad0a9 1 parent d87c6ee
@tomas tomas authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/system/linux/delay.js
View
11 lib/system/linux/delay.js
@@ -42,7 +42,16 @@ exports.set = function(new_delay, callback){
var cmd = 'crontab -l | grep -v "' + bin_path + '"; \
echo "' + delay_string + " * * * * " + bin_path + '" | crontab -'
- exec(cmd, callback);
+ exec(cmd, function(err){
+ if (err) return callback(err);
+
+ exec('crontab -l', function(err, stdout){
+ if (err) return callback(err);
+
+ var e = stdout.toString().match(bin_path) ? null : new Error('Crontab line not set!');
+ callback(e);
+ })
+ });
};
exports.unset = function(cb){
Please sign in to comment.
Something went wrong with that request. Please try again.