forked from vern/scripts
13 lines
351 B
Plaintext
13 lines
351 B
Plaintext
![]() |
#!/usr/bin/env -S bash -e
|
||
|
|
||
|
[[ -z "$2" ]] && {
|
||
|
printf 'Usage: %s username password [user|admin] [shell] <<< pubkey\n' "$0"
|
||
|
exit 1
|
||
|
}
|
||
|
/root/bin/mkmauser "$1" "$2"
|
||
|
SSH="$(cat)"
|
||
|
|
||
|
ssh 192.168.122.30 "printf '%s' \"$SSH\" | /root/bin/mktuser '${1//\'/\'\\\'\'}' '${2//\'/\'\\\'\'}' '${3//\'/\'\\\'\'}' '${4//\'/\'\\\'\'}'"
|
||
|
systemctl restart ssh-socks
|
||
|
exit
|