diff options
author | Ori Bernstein <ori@eigenstate.org> | 2020-03-08 16:31:30 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2020-03-08 16:31:30 -0700 |
commit | 50791b875552b0dc5748aa67c95776736f6ff4b7 (patch) | |
tree | 455cefab6bdbc8b64e61d5e2bfbe616222daeac0 /sys/src/cmd/auth | |
parent | e9e55a21f66a3eff114025dcb1fe62570d0fa3e6 (diff) |
add usage messages to auth/(enable disable status).
print useful message when user invokes these commands incorrectly
(thanks henesy)
Diffstat (limited to 'sys/src/cmd/auth')
-rwxr-xr-x | sys/src/cmd/auth/disable | 6 | ||||
-rwxr-xr-x | sys/src/cmd/auth/enable | 6 | ||||
-rwxr-xr-x | sys/src/cmd/auth/status | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/sys/src/cmd/auth/disable b/sys/src/cmd/auth/disable index 7ef714923..ee86b0acc 100755 --- a/sys/src/cmd/auth/disable +++ b/sys/src/cmd/auth/disable @@ -1,4 +1,10 @@ #!/bin/rc + +if(! ~ $#* 1){ + echo 'usage: auth/disable user' >[1=2] + exit usage +} + if(test -e /mnt/keys/$1) echo -n disabled > /mnt/keys/$1/status if(test -e /mnt/netkeys/$1) diff --git a/sys/src/cmd/auth/enable b/sys/src/cmd/auth/enable index f7a91189c..3c44b7eb5 100755 --- a/sys/src/cmd/auth/enable +++ b/sys/src/cmd/auth/enable @@ -1,4 +1,10 @@ #!/bin/rc + +if(! ~ $#* 1){ + echo 'usage: auth/enable user' >[1=2] + exit usage +} + if(test -e /mnt/keys/$1) echo -n ok > /mnt/keys/$1/status if(test -e /mnt/netkeys/$1) diff --git a/sys/src/cmd/auth/status b/sys/src/cmd/auth/status index 4dc0323ca..1e2e6a2a3 100755 --- a/sys/src/cmd/auth/status +++ b/sys/src/cmd/auth/status @@ -1,4 +1,10 @@ #!/bin/rc + +if(! ~ $#* 1){ + echo 'usage: auth/status user' >[1=2] + exit usage +} + cd /mnt/keys/$1 > /dev/null >[2=1] && { stat=`{cat status} exp=`{cat expire} |