@@ -45,6 +45,7 @@ usage() {
|
||||
-v|--void # Don't add the file to my files.
|
||||
-c|--clipboard # Throw the result into the clipboard
|
||||
-i|--my-ip # Get the IP you're reaching the service with, usually it will be your public address.
|
||||
-l|--login <username> # Get a login token sent to email for <username>
|
||||
|
||||
Config options (~/.config/ufw):
|
||||
secret # Your personal token. Get it at https://8fw.me/settings_form
|
||||
@@ -242,7 +243,7 @@ get_my_ip() {
|
||||
}
|
||||
|
||||
login() {
|
||||
declare api_response
|
||||
declare api_response login=$1
|
||||
|
||||
api_response=$( curl "$cfg_service_url/token_request.json?login=$login" )
|
||||
|
||||
@@ -255,7 +256,6 @@ login() {
|
||||
|
||||
get_token() {
|
||||
[[ $secret ]] && return 0
|
||||
[[ -f $cfg_file ]] && return 1
|
||||
|
||||
declare api_response login password
|
||||
|
||||
@@ -463,7 +463,7 @@ main() {
|
||||
;;
|
||||
|
||||
getmyip) get_my_ip;;
|
||||
login) login;;
|
||||
login) login "${args[0]}";;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user