Skip to content

Instantly share code, notes, and snippets.

@booo
Last active December 19, 2015 07:59
Show Gist options
  • Select an option

  • Save booo/5922316 to your computer and use it in GitHub Desktop.

Select an option

Save booo/5922316 to your computer and use it in GitHub Desktop.

Revisions

  1. @sebkur sebkur revised this gist Nov 23, 2013. 1 changed file with 20 additions and 14 deletions.
    34 changes: 20 additions & 14 deletions regip.sh
    Original file line number Diff line number Diff line change
    @@ -1,23 +1,29 @@
    #!/bin/sh

    #Postleitzah
    plz=""
    description=""
    #Username von https://ip.berlin.freifunk.net/
    usr=""
    #Passwort von https://ip.berlin.freifunk.net/
    pw=""
    # proc Network start ende
    # ./regip.sh 104.13.9 1 254
    net=$1
    i=$2
    if [ "$#" -lt "7" ]; then
    echo "usage: $0 <user> <password>" \
    "<network 104.13.9> <range start> <range end> <plz> <description>"
    exit 1
    fi

    curl --insecure -c newcookies.txt -d "usr=$usr&pw=$pw" https://ip.berlin.freifunk.net/ip/ip_neu.html > ip_neu.html
    # Postleitzahl, Beschreibung
    plz="$6"
    description="$7"
    # Username von https://ip.berlin.freifunk.net/
    usr="$1"
    # Passwort von https://ip.berlin.freifunk.net/
    pw="$2"
    # Range
    net=$3
    i=$4
    end=$5

    while [ $i -le $3 ] ; do
    # Go
    curl --insecure -c newcookies.txt -d "usr=$usr&pw=$pw" https://ip.berlin.freifunk.net/ip/ip_neu.html > ip_neu.html

    while [ $i -le $end ] ; do
    curl --insecure -b newcookies.txt -d "ip_type=wish&wishIP=$net.$i&plz=$plz&description=${description}&action=ip_neu_dyn" https://ip.berlin.freifunk.net/ip/ip_neu.html > ip_neu.html
    echo $1.$i
    #echo "ip_type=wish&wishIP=$net.$i&plz=10437&action=ip_neu_dyn"
    i=`expr $i + 1`
    done

  2. booo created this gist Jul 3, 2013.
    23 changes: 23 additions & 0 deletions regip.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/bin/sh

    #Postleitzah
    plz=""
    description=""
    #Username von https://ip.berlin.freifunk.net/
    usr=""
    #Passwort von https://ip.berlin.freifunk.net/
    pw=""
    # proc Network start ende
    # ./regip.sh 104.13.9 1 254
    net=$1
    i=$2

    curl --insecure -c newcookies.txt -d "usr=$usr&pw=$pw" https://ip.berlin.freifunk.net/ip/ip_neu.html > ip_neu.html

    while [ $i -le $3 ] ; do
    curl --insecure -b newcookies.txt -d "ip_type=wish&wishIP=$net.$i&plz=$plz&description=${description}&action=ip_neu_dyn" https://ip.berlin.freifunk.net/ip/ip_neu.html > ip_neu.html
    echo $1.$i
    #echo "ip_type=wish&wishIP=$net.$i&plz=10437&action=ip_neu_dyn"
    i=`expr $i + 1`
    done