{"id":2136,"date":"2018-08-08T08:49:18","date_gmt":"2018-08-08T07:49:18","guid":{"rendered":"https:\/\/einstein.amsterdam\/?page_id=2136"},"modified":"2018-08-08T12:29:10","modified_gmt":"2018-08-08T11:29:10","slug":"pocsag-pi-star-scripts","status":"publish","type":"page","link":"https:\/\/einstein.amsterdam\/?page_id=2136","title":{"rendered":"Pocsag Pi-Star Scripts"},"content":{"rendered":"<p>I made some scripts for Pi-Star image which work together with the dapnetapi<\/p>\n<p>msg scripts send the message, dap scripts make the content<\/p>\n<p>1st you need a pipe script !!<br \/>\nThe pipe script is always the same, only needed once to create. dont forget to change yourcall in the dapnetapi line. usage f.e.: .\/dap-lotto.sh | .\/msg-pipe.sh<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nmsg-pipe.sh<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n#!\/bin\/bash<br \/>\nTEXT=$(cat )<br \/>\nsudo pistar-dapnetapi yourcall &#8220;$TEXT&#8221;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>and then some content scripts&#8230;..<\/p>\n<p>dap-bingo.sh &#8211; lets play hambingo also download the <a href=\"https:\/\/einstein.amsterdam\/wp-content\/uploads\/hambingo.txt\">hambingo.txt<\/a> file<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;<br \/>\necho &#8220;HamBingo :)&#8221; &amp;&amp; shuf -n1 hambingo.txt &amp;&amp; echo &#8221; &#8211; &#8221; &amp;&amp; shuf -n1 hambingo.txt &amp;&amp; echo &#8221; &#8211; &#8221; &amp;&amp; shuf -n1 hambingo.txt &amp;&amp; echo &#8221; &#8211; &#8221; &amp;&amp; shuf -n1 hambingo.txt &amp;&amp; echo &#8221; &#8211; &#8221; &amp;&amp; shuf -n1 hambingo.txt<br \/>\n&#8212;&#8212;&#8212;&#8212;<br \/>\n1 liner !!!<\/p>\n<p>dap-exchange.sh &#8211; get usd\/eur\/usd exchange rates to your pager<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\necho &#8220;EUR\/USD\/EUR&#8221; &amp;&amp;curl &#8220;https:\/\/www.xe.com\/currencyconverter\/convert\/?Amount=1&amp;From=EUR&amp;To=USD&#8221; -A &#8220;Mozilla&#8221; -s | sed -n &#8220;s\/.*&gt;\\(.*\\) USD&lt;.*\/\\1 USD\/p&#8221; &amp;&amp; curl &#8220;https:\/\/www.xe.com\/currencyconverter\/convert\/?Amount=1&amp;From=USD&amp;To=EUR&#8221; -A &#8220;Mozilla&#8221; -s | sed -n &#8220;s\/.*&gt;\\(.*\\) EUR&lt;.*\/\\1 EUR\/p&#8221;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n1 liner !!!<\/p>\n<p>dap-fortune.sh &#8211; first install fortune (apt install fortune-mod)<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nfortune fortunes<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>dap-lotto.sh &#8211; send lotto numbers to pager (6\/49 random numbers)<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;<br \/>\necho &#8220;Lotto 6\/49 -&#8221;<br \/>\nfor i in {1..6}; do shuf -i 1-49 -n1; done | xargs -n6<br \/>\necho -e &#8220;- We hope you win :)&#8221;<br \/>\n&#8212;&#8212;&#8212;&#8212;-<br \/>\n3 lines !!!<\/p>\n<p>dap-weather.sh &#8211; get weather info from domoticz server<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\ncurl -s &#8216;http:\/\/192.168.2.222\/json.htm?type=devices&amp;rid=34&#8217; | grep Data | sed -e &#8216;s\/ &#8220;Data&#8221; : &#8220;\/WX EHAM \/g&#8217;|sed -e &#8216;s\/&#8221;,\/\/g&#8217;|sed -e &#8216;s\/,\/\/g&#8217; |sed -e &#8216;s\/ C\/C\/g&#8217; |sed -e &#8216;s\/ %\/%\/g&#8217; |sed -e &#8216;s\/ hPa\/hPa\/g&#8217; &amp;&amp; curl -s &#8216;http:\/\/192.168.2.222\/json.htm?type=devices&amp;rid=2&#8217; | grep Data | sed -e &#8216;s\/ &#8220;Data&#8221; : &#8220;\/Outside: \/g&#8217;|sed -e &#8216;s\/&#8221;,\/\/g&#8217; |sed -e &#8216;s\/ C\/C\/g&#8217; &amp;&amp; curl -s &#8216;http:\/\/192.168.2.222\/json.htm?type=devices&amp;rid=25&#8217; | grep Data | sed -e &#8216;s\/ &#8220;Data&#8221; : &#8220;\/Inside1: \/g&#8217;|sed -e &#8216;s\/&#8221;,\/\/g&#8217; |sed -e &#8216;s\/ C\/C\/g&#8217; &amp;&amp; curl -s &#8216;http:\/\/192.168.2.222\/json.htm?type=devices&amp;rid=1&#8217; | grep Data | sed -e &#8216;s\/ &#8220;Data&#8221; : &#8220;\/Inside2: \/g&#8217;|sed -e &#8216;s\/, 0 %&#8221;,\/\/g&#8217; |sed -e &#8216;s\/ C\/C\/g&#8217;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>msg-ip.sh &#8211; message pi-star ip to pager<br \/>\ntip and trick : if you add msg-ip.sh to rc.local just before exit0 f.e. \/home\/pi-star\/msg-ip.sh pi-star will send you the ip of pi-star to your dapnet pager \ud83d\ude42<br \/>\n&#8212;&#8212;&#8212;<br \/>\nifconfig wlan0 | grep inet | sed -e &#8220;s\/ \/\/g&#8221; | sed -e &#8220;s\/inet\/wlan0 ip\/g&#8221;| \/home\/pi-star\/msg-pipe.sh<br \/>\n&#8212;&#8212;&#8212;-<\/p>\n<p>msg-creep.sh &#8211; creepy messages on your pager (i see you, we know you etc) also download the <a href=\"https:\/\/einstein.amsterdam\/wp-content\/uploads\/creep.txt\">creep.txt<\/a> file<br \/>\n&#8212;&#8212;&#8212;&#8212;<br \/>\nshuf -n 1 creep.txt | .\/msg-pipe.sh<br \/>\n&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>extra commands and scripts:<\/p>\n<p>restart dapnergateway :<br \/>\nsudo service dapnetgateway restart<\/p>\n<p>tail dapnetgateway logfile:<br \/>\ntail -f \/var\/log\/pi-star\/D*<\/p>\n<p>tail mmdvmhost logfile:<br \/>\ntail -f \/var\/log\/pi-star\/M*<\/p>\n<p>Pipe scripts :<\/p>\n<p>msg-pipe.sh<br \/>\nnormal for you only, usage f.e.: .\/dap-lotto.sh | .\/msg-pipe.sh<br \/>\n&#8212;&#8212;&#8212;&#8211;<br \/>\n#!\/bin\/bash<br \/>\nTEXT=$(cat)<br \/>\nsudo pistar-dapnetapi yourcallsign &#8220;$TEXT&#8221;<br \/>\n&#8212;&#8212;&#8212;-<\/p>\n<p>msg-call.sh<br \/>\nsend output to a friend, usage f.e.: .\/dap-lotto,sh | .\/msg-pipe.sh callsigntosendto<br \/>\n&#8212;&#8212;&#8212;&#8211;<br \/>\n#!\/bin\/bash<br \/>\nTEXT=$(cat )<br \/>\nname=$1<br \/>\nsudo pistar-dapnetapi $1 &#8220;$TEXT&#8221;<br \/>\n&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>Here you can <a href=\"https:\/\/einstein.amsterdam\/wp-content\/uploads\/dapnet.zip\">download<\/a> all scripts and txt files in one zip file<\/p>\n<p>73, Happy paging \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>I made some scripts for Pi-Star image which work together with the dapnetapi msg scripts send the message, dap scripts make the content 1st you <a class=\"mh-excerpt-more\" href=\"https:\/\/einstein.amsterdam\/?page_id=2136\" title=\"Pocsag Pi-Star Scripts\">[&#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\/2136"}],"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=2136"}],"version-history":[{"count":9,"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/pages\/2136\/revisions"}],"predecessor-version":[{"id":2149,"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/pages\/2136\/revisions\/2149"}],"wp:attachment":[{"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}