Devices was no deleted

Alexander Morillo apps at networkbroadcast.net
Mon Feb 25 15:16:02 EST 2019


Hi everyone.

I was trying to delete all the CPE connected to Genieacs following the
instruction that i read on this forum. I used this script:
---------------------------------------------------------------------------------------------
#!/usr/bin/env bash

SERVER=192.168.20.61
COLLECTION=devices
DATA=`curl http://${SERVER}:7557/${COLLECTION}?projection=_id | jq -r
'.[]._id'`

urlencode() {
    # urlencode <string>
    old_lc_collate=$LC_COLLATE
    LC_COLLATE=C

    local length="${#1}"
    for (( i = 0; i < length; i++ )); do
        local c="${1:i:1}"
        case $c in
            [a-zA-Z0-9.~_-]) printf "$c" ;;
            *) printf '%%%02X' "'$c" ;;
        esac
    done

    LC_COLLATE=$old_lc_collate
}

#echo $DATA

for id in $DATA; do
    i=$( urlencode $id )
    echo curl "http://${SERVER}:7557/${COLLECTION}/${i}" -X DELETE
done

------------------------------------------------------------------------------------

the console shown me how all the devices was deleted:

curl
http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401776F09CD73E382F
-X DELETE
curl
http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401491F09CD73E3712
-X DELETE
curl
http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401803F09CD73E384A
-X DELETE
curl
http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401488F09CD73E370F
-X DELETE
curl
http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1875180400182F09CD742E3DE
-X DELETE
curl
http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1875180400194F09CD742E3EA
-X DELETE
curl
http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1875180400195F09CD742E3EB
-X DELETE
curl
http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401790F09CD73E383D
-X DELETE

but on the Gui all of them still appears. Can yu help me with that?

Thanks


--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20190225/2d4058e4/attachment.html>


More information about the Users mailing list