Skip to content

Commit

Permalink
ADD: allow config file on command line
Browse files Browse the repository at this point in the history
let the user pass in the config file to use on the command line as the
first argument.  allows a bit more configurability.
  • Loading branch information
zengargoyle committed Mar 22, 2011
1 parent 2ae4ec7 commit c75b7e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/SelfControl
Expand Up @@ -26,7 +26,7 @@ openlog('SelfControl','pid','local0');
my $UID = $<;
$UID = $ENV{SUDO_UID} if exists $ENV{SUDO_UID};
my $HOME = (getpwuid($UID))[7];
my $ConfigFile = "$HOME/.selfcontrol";
my $ConfigFile = $ARGV[0] || "$HOME/.selfcontrol";

#
# if root, apply Config and exit.
Expand Down
2 changes: 1 addition & 1 deletion lib/SelfControl.pm
Expand Up @@ -79,7 +79,7 @@ sub run {
if ($self->{started}) {
save_config($self->{config_file}, $self->{config});
if (scalar @{$self->{config}->{hosts}}) {
system(@{$self->{sudo}}, $0);
system(@{$self->{sudo}}, $0, $self->{config_file});
}
}
bless $self, __PACKAGE__;
Expand Down

0 comments on commit c75b7e6

Please sign in to comment.