mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2024-11-22 13:24:40 +01:00
23 lines
924 B
Plaintext
23 lines
924 B
Plaintext
|
#! /usr/bin/env nix-shell
|
||
|
#! nix-shell -i bash -p curl htmlq
|
||
|
|
||
|
# echo "Fetching cookie and CSRF token..."
|
||
|
# form=$(curl --silent --location --junk-session-cookies --cookie-jar /tmp/wifionice "https://login.wifionice.de/en/" --resolve login.wifionice.de:443:10.101.64.10 -i | htmlq "input")
|
||
|
|
||
|
# keys=$(htmlq "input" --attribute "name" <<< "$form")
|
||
|
# values=$(htmlq "input" --attribute "value" <<< "$form")
|
||
|
# payload=$(paste --delimiters="=" <(echo "$keys") <(echo "$values") | tr "\n" "&")
|
||
|
|
||
|
# echo "Payload: \"$payload\""
|
||
|
# echo "POSTing payload..."
|
||
|
|
||
|
# curl --cookie /tmp/wifionice "https://login.wifionice.de/en/" --resolve login.wifionice.de:443:10.101.64.10 -d "$payload"
|
||
|
|
||
|
def main [
|
||
|
interface: string
|
||
|
type: string
|
||
|
] {
|
||
|
let form = curl --silent --location --junk-session-cookies --cookie-jar /tmp/wifionice 'https://login.wifionice.de/en/' --resolve 'login.wifionice.de:443:10.101.64.10' -i | htmlq 'input';
|
||
|
# TODO
|
||
|
}
|