diff options
Diffstat (limited to '.local/bin/setwp')
-rwxr-xr-x | .local/bin/setwp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/.local/bin/setwp b/.local/bin/setwp index 70577ae..6686e67 100755 --- a/.local/bin/setwp +++ b/.local/bin/setwp @@ -81,9 +81,14 @@ sub main my $wp; my $ret; - $wp = choose_wp(get_pool_files()); - $ret = set_wp($wp); - if (@ARGV == 0 || $ARGV[0] ne "-nw") { + if (@ARGV != 0 && -f $ARGV[0]) { + $ret = set_wp($ARGV[0]); + } + else { + $wp = choose_wp(get_pool_files()); + $ret = set_wp($wp); + } + if (@ARGV != 0 && $ARGV[0] eq "-nw") { notify() if ($ret == 0); notify_error() if ($ret != 0); } |