* If start start/restart namespace
(cb)
| 775 | * If start <namespace> start/restart namespace |
| 776 | */ |
| 777 | function restartExistingNameSpace(cb) { |
| 778 | if (!isNaN(script) || |
| 779 | (typeof script === 'string' && script.indexOf('/') != -1) || |
| 780 | (typeof script === 'string' && path.extname(script) !== '')) |
| 781 | return cb(null); |
| 782 | |
| 783 | if (script !== 'all') { |
| 784 | that.Client.getProcessIdsByNamespace(script, function (err, ids) { |
| 785 | if (err && cb) return cb(err); |
| 786 | if (ids.length > 0) { |
| 787 | that._operate('restartProcessId', script, opts, function (err, list) { |
| 788 | if (err) return cb(err); |
| 789 | Common.printOut(conf.PREFIX_MSG + 'Process successfully started'); |
| 790 | return cb(true, list); |
| 791 | }); |
| 792 | } |
| 793 | else return cb(null); |
| 794 | }); |
| 795 | } |
| 796 | else { |
| 797 | that._operate('restartProcessId', 'all', function(err, list) { |
| 798 | if (err) return cb(err); |
| 799 | Common.printOut(conf.PREFIX_MSG + 'Process successfully started'); |
| 800 | return cb(true, list); |
| 801 | }); |
| 802 | } |
| 803 | } |
| 804 | |
| 805 | function restartExistingProcessId(cb) { |
| 806 | if (isNaN(script)) return cb(null); |