Skip to content

Commit 8b07f84

Browse files
authored
Merge pull request #9 from mikhailnov/fix-exit-code
Fix exit code when config is not readable
2 parents aaf0e8f + a251c8b commit 8b07f84

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

just-backup-btrfs

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class Just_backup_btrfs {
2828
*/
2929
function __construct ($config) {
3030
if (!$config) {
31-
exit("Incorrect configuration, aborted\n");
31+
echo "Incorrect configuration, aborted\n";
32+
exit(1);
3233
}
3334
$this->config = $config;
3435
if (file_exists('/usr/sbin/btrfs')) {
@@ -38,7 +39,8 @@ class Just_backup_btrfs {
3839
} elseif (file_exists('/bin/btrfs')) {
3940
$this->binary = '/bin/btrfs';
4041
} else {
41-
throw new RuntimeException("Can't find btrfs binary");
42+
echo "Can't find btrfs binary\n";
43+
exit(1);
4244
}
4345
}
4446
function backup () {

0 commit comments

Comments
 (0)