add usage messages to auth/(enable disable status).
print useful message when user invokes these commands incorrectly (thanks henesy)
This commit is contained in:
parent
e9e55a21f6
commit
50791b8755
3 changed files with 18 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue