{"id":1802,"date":"2017-11-19T21:44:12","date_gmt":"2017-11-19T19:44:12","guid":{"rendered":"https:\/\/einstein.amsterdam\/?page_id=1802"},"modified":"2017-11-20T19:30:27","modified_gmt":"2017-11-20T17:30:27","slug":"sharkrf-openspot-api-menu","status":"publish","type":"page","link":"https:\/\/einstein.amsterdam\/?page_id=1802","title":{"rendered":"SharkRF openSPOT API Menu"},"content":{"rendered":"<p>work in progress \ud83d\ude42<\/p>\n<p>looking nice, alot of functions already build in<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1807 size-mh-magazine-lite-content\" src=\"https:\/\/einstein.amsterdam\/wp-content\/uploads\/Screen-Shot-2017-11-19-at-21.03.32-358x381.png\" alt=\"\" width=\"358\" height=\"381\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1808 size-mh-magazine-lite-content\" src=\"https:\/\/einstein.amsterdam\/wp-content\/uploads\/Screen-Shot-2017-11-19-at-21.04.20-371x381.png\" alt=\"\" width=\"371\" height=\"381\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1809 size-mh-magazine-lite-content\" src=\"https:\/\/einstein.amsterdam\/wp-content\/uploads\/Screen-Shot-2017-11-19-at-21.04.40-359x381.png\" alt=\"\" width=\"359\" height=\"381\" \/><\/p>\n<p>sh code below :<\/p>\n<p><div class=\"su-divider su-divider-style-default\" style=\"margin:15px 0;border-width:3px;border-color:#999999\"><\/div><br \/>\n<code><br \/>\n#!\/bin\/sh<br \/>\npassword=\"openspot\"<br \/>\nserver=\"openspot.local\"<br \/>\ntoken=\"Login first (1) !!\"<br \/>\nshow_menu(){<br \/>\nNORMAL=`echo \"\\033[m\"`<br \/>\nMENU=`echo \"\\033[36m\"` #Blue<br \/>\nNUMBER=`echo \"\\033[33m\"` #yellow<br \/>\nFGRED=`echo \"\\033[41m\"`<br \/>\nRED_TEXT=`echo \"\\033[31m\"`<br \/>\nENTER_LINE=`echo \"\\033[33m\"`<br \/>\necho  \"${MENU}************************************************${NORMAL}\"<br \/>\necho  \" SharkRF openSPOT Menu \"<br \/>\necho  \" script made by PD2EMC\"<br \/>\necho  \" \"<br \/>\necho  \"${NUMBER} Server:   ${RED_TEXT}\" $server<br \/>\necho  \"${NUMBER} Password: ${RED_TEXT}\" $password<br \/>\necho  \"${NUMBER} Token:    ${RED_TEXT}\" $token<br \/>\necho  \" \"<br \/>\necho  \"${MENU}*******************Main Menu********************${NORMAL}\"<br \/>\necho  \"${MENU}**${NUMBER} 1)${MENU} Login to openSPOT ${NORMAL}\"<br \/>\necho  \"${MENU}**${NUMBER} 2)${MENU} Check Authorisation ${NORMAL}\"<br \/>\necho  \"${MENU}**${NUMBER} 3)${MENU} openSPOT Info Menu ${NORMAL}\"<br \/>\necho  \"${MENU}**${NUMBER} 4)${MENU} openSPOT Profiles Menu${NORMAL}\"<br \/>\necho  \"${MENU}**${NUMBER} 5)${MENU} nothing yet ${NORMAL}\"<br \/>\necho  \"${MENU}**${NUMBER} 6)${MENU} nothing yet ${NORMAL}\"<br \/>\necho  \"${MENU}**${NUMBER} 7)${MENU} nothing yet ${NORMAL}\"<br \/>\necho  \"${MENU}**${NUMBER} 8)${MENU} Logout openSPOT ${NORMAL}\"<br \/>\necho  \"${MENU}**${NUMBER} 9)${MENU} Reboot openSPOT ${NORMAL}\"<br \/>\necho  \"${MENU}**${NUMBER} 0)${MENU} Exit Menu ${NORMAL}\"<br \/>\necho  \"${MENU}************************************************${NORMAL}\"<br \/>\necho  \"${ENTER_LINE}Choose a menu option and enter or ${RED_TEXT}enter to exit. ${NORMAL}\"<br \/>\nread opt<br \/>\nwhile [ opt != '' ]\ndo<br \/>\nif [[ $opt = \"\" ]]; then<br \/>\nexit;<br \/>\nelse<br \/>\ncase $opt in<br \/>\n1)<br \/>\noption_picked \"Login to SharkRF openSPOT ...\";<br \/>\ntokenurl=`curl http:\/\/$server\/gettok.cgi| sed 's\/{\"token\":\"\/\/'|sed 's\/\"}\/\/'`;<br \/>\ntoken=${tokenurl};<br \/>\ntokenpass=$token$password;<br \/>\ndigest=`printf ${tokenpass} | shasum -a 256 | sed 's\/-\/\/'`;<br \/>\njwt=`curl -X POST --header \"Content-Type: application\/json\" --data \"{\\\"token\\\":\\\"$token\\\",\\\"digest\\\":\\\"$digest\\\"}\" \"http:\/\/$server\/login.cgi\" | sed 's\/{\"hostname\":\"openspot\",\"jwt\":\"\/\/'|sed 's\/\"}\/\/'`;<br \/>\nclear;<br \/>\nshow_menu;<br \/>\n;;<br \/>\n2)<br \/>\n#clear;<br \/>\noption_picked \"Checking Autorization\";<br \/>\n#echo \"Checking authorisation\";<br \/>\ncurl -H \"Authorization: Bearer $jwt\" http:\/\/$server\/checkauth.cgi | json_pp;<br \/>\necho \"Press [enter] key to continue. . .\";<br \/>\nread enterKey;<br \/>\nclear;<br \/>\nshow_menu;<br \/>\n;;<br \/>\n3) clear;<br \/>\n#submenu 1 is the openSPOT Information menu<br \/>\nsub_menu1;<br \/>\n;;<br \/>\n4) clear;<br \/>\n# Submenu 2 #profiles menu option_picked \"Sub Menu 2\";<br \/>\nsub_menu2;<br \/>\n;;<br \/>\n5) clear;<br \/>\noption_picked \"Option 5 Picked\";<br \/>\nshow_menu;<br \/>\n;;<br \/>\n6) clear;<br \/>\noption_picked \"Option 6 Picked\";<br \/>\nshow_menu;<br \/>\n;;<br \/>\n7) clear;<br \/>\noption_picked \"Option 7 Picked\";<br \/>\nshow_menu;<br \/>\n;;<br \/>\n8)<br \/>\noption_picked \"Logout openSPOT ...\";<br \/>\ncurl -H \"Authorization: Bearer $jwt\" http:\/\/$server\/logout.cgi | json_pp;<br \/>\ntoken=\"Login first (1) !!\";<br \/>\ndigest=\"\";<br \/>\njwt=\"\";<br \/>\nclear;<br \/>\nshow_menu;<br \/>\n;;<br \/>\n9)<br \/>\noption_picked \"Rebooting openSPOT\";<br \/>\ncurl -H \"Authorization: Bearer $jwt\" http:\/\/$server\/reboot.cgi | json_pp<br \/>\ntoken=\"Login first (1) !!\";<br \/>\ndigest=\"\";<br \/>\njwt=\"\";<br \/>\nclear;<br \/>\nshow_menu;;<br \/>\n0)<br \/>\necho \"Bye bye $USER\";<br \/>\nexit ;;<br \/>\nx)exit;<br \/>\n;;<br \/>\n\\n)exit;<br \/>\n;;<br \/>\n*)clear;<br \/>\noption_picked \"Pick an option from the menu\";<br \/>\nshow_menu;<br \/>\n;;<br \/>\nesac<br \/>\nfi<br \/>\ndone<br \/>\n}<\/code><\/p>\n<p>function option_picked() {<br \/>\nCOLOR=&#8217;\\033[01;31m&#8217; # bold red<br \/>\nRESET=&#8217;\\033[00;00m&#8217; # normal white<br \/>\nMESSAGE=${@:-&#8220;${RESET}Error: No message passed&#8221;}<br \/>\necho &#8220;${COLOR}${MESSAGE}${RESET}&#8221;<br \/>\n}<\/p>\n<p>sub_menu1(){<br \/>\nNORMAL=`echo &#8220;\\033[m&#8221;`<br \/>\nMENU=`echo &#8220;\\033[36m&#8221;` #Blue<br \/>\nNUMBER=`echo &#8220;\\033[33m&#8221;` #yellow<br \/>\nFGRED=`echo &#8220;\\033[41m&#8221;`<br \/>\nRED_TEXT=`echo &#8220;\\033[31m&#8221;`<br \/>\nENTER_LINE=`echo &#8220;\\033[33m&#8221;`<br \/>\necho &#8220;${MENU}************************************************${NORMAL}&#8221;<br \/>\necho &#8221; SharkRF openSPOT Menu &#8221;<br \/>\necho &#8221; script made by PD2EMC&#8221;<br \/>\necho &#8221; &#8221;<br \/>\necho &#8220;${NUMBER} Server: ${RED_TEXT}&#8221; $server<br \/>\necho &#8220;${NUMBER} Password: ${RED_TEXT}&#8221; $password<br \/>\necho &#8220;${NUMBER} Token: ${RED_TEXT}&#8221; $token<br \/>\necho &#8221; &#8221;<br \/>\necho &#8220;${MENU}*******************Info Menu********************${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 1)${MENU} Login to openSPOT ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 2)${MENU} Check Authorisation ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 3)${MENU} Show Token Info ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 4)${MENU} openSPOT Info ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 5)${MENU} Networksettings ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 6)${MENU} Radio Status ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 7)${MENU} openSPOT Profiles ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 8)${MENU} Reboot openSPOT ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 9)${MENU} Back to Main Menu ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 0)${MENU} Exit Menu ${NORMAL}&#8221;<\/p>\n<p>echo &#8220;${MENU}************************************************${NORMAL}&#8221;<br \/>\necho &#8220;${ENTER_LINE}Choose a menu option and enter or ${RED_TEXT}enter to exit. ${NORMAL}&#8221;<br \/>\nread sub1<br \/>\nwhile [ sub1 != &#8221; ]\ndo<br \/>\nif [[ $sub1 = &#8220;&#8221; ]]; then<br \/>\nexit;<br \/>\nelse<br \/>\ncase $sub1 in<br \/>\n1)<br \/>\noption_picked &#8220;Login to SharkRF openSPOT &#8230;&#8221;;<br \/>\ntokenurl=`curl http:\/\/$server\/gettok.cgi| sed &#8216;s\/{&#8220;token&#8221;:&#8221;\/\/&#8217;|sed &#8216;s\/&#8221;}\/\/&#8217;`;<br \/>\ntoken=${tokenurl};<br \/>\ntokenpass=$token$password;<br \/>\ndigest=`printf ${tokenpass} | shasum -a 256 | sed &#8216;s\/-\/\/&#8217;`;<br \/>\njwt=`curl -X POST &#8211;header &#8220;Content-Type: application\/json&#8221; &#8211;data &#8220;{\\&#8221;token\\&#8221;:\\&#8221;$token\\&#8221;,\\&#8221;digest\\&#8221;:\\&#8221;$digest\\&#8221;}&#8221; &#8220;http:\/\/$server\/login.cgi&#8221; | sed &#8216;s\/{&#8220;hostname&#8221;:&#8221;openspot&#8221;,&#8221;jwt&#8221;:&#8221;\/\/&#8217;|sed &#8216;s\/&#8221;}\/\/&#8217;`;<br \/>\nclear;<br \/>\nsub_menu1;<br \/>\n;;<br \/>\n2)<br \/>\n#clear;<br \/>\noption_picked &#8220;Checking Autorization&#8221;;<br \/>\n#echo &#8220;Checking authorisation&#8221;;<br \/>\ncurl -H &#8220;Authorization: Bearer $jwt&#8221; http:\/\/$server\/checkauth.cgi | json_pp;<br \/>\necho &#8220;Press [enter] key to continue. . .&#8221;;<br \/>\nread enterKey;<br \/>\nclear;<br \/>\nsub_menu1;<br \/>\n;;<br \/>\n3)<br \/>\noption_picked &#8220;Show Token Info &#8230;&#8221;;<br \/>\necho &#8220;Token: &#8221; $token;<br \/>\necho &#8220;Digest: &#8221; $digest;<br \/>\necho &#8220;JWT: &#8221; $jwt;<br \/>\necho &#8220;Press [enter] key to continue. . .&#8221;;<br \/>\nread enterKey;<br \/>\nclear;<br \/>\nsub_menu1;<br \/>\n;;<\/p>\n<p>4)<br \/>\noption_picked &#8220;openSPOT Information &#8230;&#8221;;<br \/>\ncurl -H &#8220;Authorization: Bearer $jwt&#8221; http:\/\/$server\/info.cgi | json_pp;<br \/>\necho &#8220;Press [enter] key to continue. . .&#8221;;<br \/>\nread enterKey;<br \/>\nclear;<br \/>\nsub_menu1;<br \/>\n;;<br \/>\n5)<br \/>\noption_picked &#8220;Networksettings &#8230;&#8221;;<br \/>\ncurl -H &#8220;Authorization: Bearer $jwt&#8221; http:\/\/$server\/netsettings.cgi | json_pp;<br \/>\necho &#8220;Press [enter] key to continue. . .&#8221;;<br \/>\nread enterKey;<br \/>\nclear;<br \/>\nsub_menu1;<br \/>\n;;<\/p>\n<p>6)<br \/>\noption_picked &#8220;Getting Radio Status &#8230;&#8221;;<br \/>\ncurl -H &#8220;Authorization: Bearer $jwt&#8221; http:\/\/$server\/status.cgi | json_pp;<br \/>\necho &#8220;Press [enter] key to continue. . .&#8221;;<br \/>\nread enterKey;<br \/>\nclear;<br \/>\nsub_menu1;<br \/>\n;;<br \/>\n7)<br \/>\noption_picked &#8220;Getting openSPOT Profiles &#8230;&#8221;;<br \/>\ncurl -H &#8220;Authorization: Bearer $jwt&#8221; http:\/\/$server\/cpsettings.cgi | json_pp;<br \/>\necho &#8220;test&#8221;<br \/>\necho &#8220;Press [enter] key to continue. . .&#8221;;<br \/>\nread enterKey;<br \/>\nclear;<br \/>\nsub_menu1;<br \/>\n;;<br \/>\n8) clear;<br \/>\noption_picked &#8220;Reboot openSPOT &#8230;&#8221;;<br \/>\ncurl -H &#8220;Authorization: Bearer $jwt&#8221; http:\/\/$server\/reboot.cgi | json_pp;<br \/>\ntoken=&#8221;Login first (1) !!&#8221;;<br \/>\ndigest=&#8221;&#8221;;<br \/>\njwt=&#8221;&#8221;;<br \/>\nclear;<br \/>\nshow_menu;<br \/>\n;;<br \/>\n9) clear;<br \/>\nshow_menu;<br \/>\n;;<br \/>\n0) echo &#8220;Bye bye $USER&#8221;;<br \/>\nexit 1;;<\/p>\n<p>x)exit;<br \/>\n;;<\/p>\n<p>\\n)exit;<br \/>\n;;<\/p>\n<p>*)clear;<br \/>\noption_picked &#8220;Pick an option from the menu&#8221;;<br \/>\nsub_menu1;<br \/>\n;;<br \/>\nesac<br \/>\nfi<br \/>\ndone<br \/>\n}<\/p>\n<p>#openSPOT Profiles Menu<br \/>\nsub_menu2(){<br \/>\nNORMAL=`echo &#8220;\\033[m&#8221;`<br \/>\nMENU=`echo &#8220;\\033[36m&#8221;` #Blue<br \/>\nNUMBER=`echo &#8220;\\033[33m&#8221;` #yellow<br \/>\nFGRED=`echo &#8220;\\033[41m&#8221;`<br \/>\nRED_TEXT=`echo &#8220;\\033[31m&#8221;`<br \/>\nENTER_LINE=`echo &#8220;\\033[33m&#8221;`<br \/>\necho &#8220;${MENU}************************************************${NORMAL}&#8221;<br \/>\necho &#8221; SharkRF openSPOT Menu &#8221;<br \/>\necho &#8221; script made by PD2EMC&#8221;<br \/>\necho &#8221; &#8221;<br \/>\necho &#8220;${NUMBER} Server: ${RED_TEXT}&#8221; $server<br \/>\necho &#8220;${NUMBER} Password: ${RED_TEXT}&#8221; $password<br \/>\necho &#8220;${NUMBER} Token: ${RED_TEXT}&#8221; $token<br \/>\necho &#8221; &#8221;<br \/>\necho &#8220;${MENU}*****************Profile Menu*******************${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 1)${MENU} Login to openSPOT ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 2)${MENU} openSPOT Profiles ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 3)${MENU} Switch to Profile 0 DMR Brandmeister${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 4)${MENU} Switch to Profile 1 YSFReflector${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 5)${MENU} Switch to Profile 2 FCSReflector${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 6)${MENU} Switch to Profile 3 C4FM-&gt;DMR${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 7)${MENU} Switch to Profile 4 DMR-&gt;C4FM${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 8)${MENU} Reboot openSPOT ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 9)${MENU} Back to Main Menu ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}**${NUMBER} 0)${MENU} Exit Menu ${NORMAL}&#8221;<br \/>\necho &#8220;${MENU}************************************************${NORMAL}&#8221;<br \/>\necho &#8220;${ENTER_LINE}Choose a menu option and enter or ${RED_TEXT}enter to exit. ${NORMAL}&#8221;<br \/>\nread sub2<br \/>\nwhile [ sub2 != &#8221; ]\ndo<br \/>\nif [[ $sub2 = &#8220;&#8221; ]]; then<br \/>\nexit;<br \/>\nelse<br \/>\ncase $sub2 in<br \/>\n1)<br \/>\noption_picked &#8220;Login to SharkRF openSPOT &#8230;&#8221;;<br \/>\ntokenurl=`curl http:\/\/$server\/gettok.cgi| sed &#8216;s\/{&#8220;token&#8221;:&#8221;\/\/&#8217;|sed &#8216;s\/&#8221;}\/\/&#8217;`;<br \/>\ntoken=${tokenurl};<br \/>\ntokenpass=$token$password;<br \/>\ndigest=`printf ${tokenpass} | shasum -a 256 | sed &#8216;s\/-\/\/&#8217;`;<br \/>\njwt=`curl -X POST &#8211;header &#8220;Content-Type: application\/json&#8221; &#8211;data &#8220;{\\&#8221;token\\&#8221;:\\&#8221;$token\\&#8221;,\\&#8221;digest\\&#8221;:\\&#8221;$digest\\&#8221;}&#8221; &#8220;http:\/\/$server\/login.cgi&#8221; | sed &#8216;s\/{&#8220;hostname&#8221;:&#8221;openspot&#8221;,&#8221;jwt&#8221;:&#8221;\/\/&#8217;|sed &#8216;s\/&#8221;}\/\/&#8217;`;<br \/>\nclear;<br \/>\nsub_menu2;<br \/>\n;;<br \/>\n2) clear;<br \/>\noption_picked &#8220;Getting opSPOT Profile settings &#8230;&#8221;;<br \/>\ncurl -H &#8220;Authorization: Bearer $jwt&#8221; http:\/\/$server\/cpsettings.cgi | json_pp;<br \/>\necho &#8220;Press [enter] key to continue. . .&#8221;;<br \/>\nread enterKey;<br \/>\nclear;<br \/>\nsub_menu2;<br \/>\n;;<\/p>\n<p>3)<br \/>\noption_picked &#8220;Switching to Profile 0&#8221;;<br \/>\ncurl -X POST -H &#8220;Authorization: Bearer $jwt&#8221; &#8211;data &#8220;{\\&#8221;active_cp\\&#8221;:\\&#8221;0\\&#8221;}&#8221; &#8220;http:\/\/$server\/cpsettings.cgi&#8221;;<br \/>\ntoken=&#8221;Login first (1) !!&#8221;;<br \/>\ndigest=&#8221;&#8221;;<br \/>\njwt=&#8221;&#8221;;<br \/>\nclear;<br \/>\nshow_menu;<br \/>\n;;<\/p>\n<p>4)<br \/>\noption_picked &#8220;Switching to Profile 1&#8221;;<br \/>\ncurl -X POST -H &#8220;Authorization: Bearer $jwt&#8221; &#8211;data &#8220;{\\&#8221;active_cp\\&#8221;:\\&#8221;1\\&#8221;}&#8221; &#8220;http:\/\/$server\/cpsettings.cgi&#8221;;<br \/>\ntoken=&#8221;Login first (1) !!&#8221;;<br \/>\ndigest=&#8221;&#8221;;<br \/>\njwt=&#8221;&#8221;;<br \/>\nclear;<br \/>\nshow_menu;<br \/>\n;;<\/p>\n<p>5)<br \/>\noption_picked &#8220;Switching to Profile 2&#8221;;<br \/>\ncurl -X POST -H &#8220;Authorization: Bearer $jwt&#8221; &#8211;data &#8220;{\\&#8221;active_cp\\&#8221;:\\&#8221;2\\&#8221;}&#8221; &#8220;http:\/\/$server\/cpsettings.cgi&#8221;;<br \/>\ntoken=&#8221;Login first (1) !!&#8221;;<br \/>\ndigest=&#8221;&#8221;;<br \/>\njwt=&#8221;&#8221;;<br \/>\nclear;<br \/>\nshow_menu;<br \/>\n;;<\/p>\n<p>6)<br \/>\noption_picked &#8220;Switching to Profile 3&#8221;;<br \/>\ncurl -X POST -H &#8220;Authorization: Bearer $jwt&#8221; &#8211;data &#8220;{\\&#8221;active_cp\\&#8221;:\\&#8221;3\\&#8221;}&#8221; &#8220;http:\/\/$server\/cpsettings.cgi&#8221;;<br \/>\ntoken=&#8221;Login first (1) !!&#8221;;<br \/>\ndigest=&#8221;&#8221;;<br \/>\njwt=&#8221;&#8221;;<br \/>\nclear;<br \/>\nshow_menu;<br \/>\n;;<\/p>\n<p>7)<br \/>\noption_picked &#8220;Switching to Profile 4&#8221;;<br \/>\ncurl -X POST -H &#8220;Authorization: Bearer $jwt&#8221; &#8211;data &#8220;{\\&#8221;active_cp\\&#8221;:\\&#8221;4\\&#8221;}&#8221; &#8220;http:\/\/$server\/cpsettings.cgi&#8221;;<br \/>\ntoken=&#8221;Login first (1) !!&#8221;;<br \/>\ndigest=&#8221;&#8221;;<br \/>\njwt=&#8221;&#8221;;<br \/>\nclear;<br \/>\nshow_menu;<br \/>\n;;<\/p>\n<p>8)<br \/>\noption_picked &#8220;Rebooting openSPOT&#8221;;<br \/>\ncurl -H &#8220;Authorization: Bearer $jwt&#8221; http:\/\/$server\/reboot.cgi | json_pp<br \/>\ntoken=&#8221;Login first (1) !!&#8221;;<br \/>\ndigest=&#8221;&#8221;;<br \/>\njwt=&#8221;&#8221;;<br \/>\nclear;<br \/>\nshow_menu;;<\/p>\n<p>9) clear;<br \/>\nshow_menu;;<\/p>\n<p>0) echo &#8220;Bye bye $USER&#8221;;<br \/>\nexit 1;;<\/p>\n<p>x)exit;<br \/>\n;;<\/p>\n<p>\\n)exit;<br \/>\n;;<\/p>\n<p>*)clear;<br \/>\noption_picked &#8220;Pick an option from the menu&#8221;;<br \/>\nsub_menu1;<br \/>\n;;<br \/>\nesac<br \/>\nfi<br \/>\ndone<br \/>\n}<\/p>\n<p>clear<br \/>\nshow_menu<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>work in progress \ud83d\ude42 looking nice, alot of functions already build in sh code below : #!\/bin\/sh password=&#8221;openspot&#8221; server=&#8221;openspot.local&#8221; token=&#8221;Login first (1) !!&#8221; show_menu(){ NORMAL=`echo <a class=\"mh-excerpt-more\" href=\"https:\/\/einstein.amsterdam\/?page_id=1802\" title=\"SharkRF openSPOT API Menu\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/pages\/1802"}],"collection":[{"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1802"}],"version-history":[{"count":13,"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/pages\/1802\/revisions"}],"predecessor-version":[{"id":1823,"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/pages\/1802\/revisions\/1823"}],"wp:attachment":[{"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}