<div dir="ltr"><div dir="ltr">You did not read the instructions for the script. The instructions state "If you want to change the script to perform the work instead of echoing the command to the console, delete the echo on line 28"</div><div dir="ltr"><br></div><div>So you can either delete the echo, or copy and paste those lines into your console.</div><div><br></div><div>-dan</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 25, 2019 at 11:16 AM Alexander Morillo <<a href="mailto:apps@networkbroadcast.net">apps@networkbroadcast.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi everyone.<br><br>I was trying to delete all the CPE connected to Genieacs following the instruction that i read on this forum. I used this script:</div><div dir="ltr">---------------------------------------------------------------------------------------------<br></div><div dir="ltr">#!/usr/bin/env bash<br></div><div dir="ltr"><br></div><div dir="ltr">SERVER=192.168.20.61<br>COLLECTION=devices<br>DATA=`curl http://${SERVER}:7557/${COLLECTION}?projection=_id | jq -r '.[]._id'`<br><br>urlencode() {<br>    # urlencode <string><br>    old_lc_collate=$LC_COLLATE<br>    LC_COLLATE=C<br><br>    local length="${#1}"<br>    for (( i = 0; i < length; i++ )); do<br>        local c="${1:i:1}"<br>        case $c in<br>            [a-zA-Z0-9.~_-]) printf "$c" ;;<br>            *) printf '%%%02X' "'$c" ;;<br>        esac<br>    done<br><br>    LC_COLLATE=$old_lc_collate<br>}<br><br>#echo $DATA<br><br>for id in $DATA; do<br>    i=$( urlencode $id )<br>    echo curl "http://${SERVER}:7557/${COLLECTION}/${i}" -X DELETE<br>done<br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------------------------------------------------------------</div><div dir="ltr"><br></div><div dir="ltr">the console shown me how all the devices was deleted: <br></div><div dir="ltr"><br></div><div dir="ltr">curl <a href="http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401776F09CD73E382F" target="_blank">http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401776F09CD73E382F</a> -X DELETE<br>curl <a href="http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401491F09CD73E3712" target="_blank">http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401491F09CD73E3712</a> -X DELETE<br>curl <a href="http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401803F09CD73E384A" target="_blank">http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401803F09CD73E384A</a> -X DELETE<br>curl <a href="http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401488F09CD73E370F" target="_blank">http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401488F09CD73E370F</a> -X DELETE<br>curl <a href="http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1875180400182F09CD742E3DE" target="_blank">http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1875180400182F09CD742E3DE</a> -X DELETE<br>curl <a href="http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1875180400194F09CD742E3EA" target="_blank">http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1875180400194F09CD742E3EA</a> -X DELETE<br>curl <a href="http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1875180400195F09CD742E3EB" target="_blank">http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1875180400195F09CD742E3EB</a> -X DELETE<br>curl <a href="http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401790F09CD73E383D" target="_blank">http://192.168.20.61:7557/devices/000018-Hi3798MV200-UPO1877180401790F09CD73E383D</a> -X DELETE</div><div dir="ltr"><br></div><div dir="ltr">but on the Gui all of them still appears. Can yu help me with that? </div><div dir="ltr"><br>Thanks<br></div><div dir="ltr"><br></div><div dir="ltr"><br>-- <br><div dir="ltr" class="gmail-m_-5816068900231717855gmail_signature"><div dir="ltr"><img src="https://drive.google.com/a/networkbroadcast.net/uc?id=1_FRZizsEI5sJErXuGqfY43Sui9gcVbsc&export=download" width="200" height="66"><br></div></div></div></div></div></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a><br>
<a href="http://lists.genieacs.com/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.genieacs.com/mailman/listinfo/users</a><br>
</blockquote></div>