add usage messages to auth/(enable disable status).

print useful message when user invokes these commands incorrectly
(thanks henesy)
This commit is contained in:
Ori Bernstein 2020-03-08 16:31:30 -07:00
parent e9e55a21f6
commit 50791b8755
3 changed files with 18 additions and 0 deletions

View file

@ -1,4 +1,10 @@
#!/bin/rc #!/bin/rc
if(! ~ $#* 1){
echo 'usage: auth/disable user' >[1=2]
exit usage
}
if(test -e /mnt/keys/$1) if(test -e /mnt/keys/$1)
echo -n disabled > /mnt/keys/$1/status echo -n disabled > /mnt/keys/$1/status
if(test -e /mnt/netkeys/$1) if(test -e /mnt/netkeys/$1)

View file

@ -1,4 +1,10 @@
#!/bin/rc #!/bin/rc
if(! ~ $#* 1){
echo 'usage: auth/enable user' >[1=2]
exit usage
}
if(test -e /mnt/keys/$1) if(test -e /mnt/keys/$1)
echo -n ok > /mnt/keys/$1/status echo -n ok > /mnt/keys/$1/status
if(test -e /mnt/netkeys/$1) if(test -e /mnt/netkeys/$1)

View file

@ -1,4 +1,10 @@
#!/bin/rc #!/bin/rc
if(! ~ $#* 1){
echo 'usage: auth/status user' >[1=2]
exit usage
}
cd /mnt/keys/$1 > /dev/null >[2=1] && { cd /mnt/keys/$1 > /dev/null >[2=1] && {
stat=`{cat status} stat=`{cat status}
exp=`{cat expire} exp=`{cat expire}