TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Scott Barton
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 13
    • Best 2
    • Controversial 0
    • Groups 0

    Scott Barton

    @Scott Barton

    2
    Reputation
    20
    Profile views
    13
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Scott Barton Unfollow Follow

    Best posts made by Scott Barton

    • RE: How do you install TRIGGERcmd on Raspberry pi with OpenWRT?

      I just updated the scripts that TRIGGERcmd runs to have full paths, and now it works, thanks!

      posted in Raspberry Pi
      Scott BartonS
      Scott Barton
    • RE: Turn your VPN on/off

      For OpenWRT you can start the VPN interface with:
      ifup VPNInterfaceName

      And Stop it with:
      ifdown VPNInterfaceName

      More info:
      https://openwrt.org/docs/guide-user/base-system/basic-networking#network_management

      posted in Example Commands
      Scott BartonS
      Scott Barton

    Latest posts made by Scott Barton

    • RE: How do you install TRIGGERcmd on Raspberry pi with OpenWRT?

      I just updated the scripts that TRIGGERcmd runs to have full paths, and now it works, thanks!

      posted in Raspberry Pi
      Scott BartonS
      Scott Barton
    • RE: How do you install TRIGGERcmd on Raspberry pi with OpenWRT?

      @Russ yes it's not using the full directory. Here is the adblock.sh script:

      #/bin/ash
      
      echo running /scripts/adblock.sh now >> /tmp/adblock.log
      env >> /tmp/adenv.log
      pwd >> /tmp/adpwd.log
      
      case "$1" in
        "on")
          enableadblock
          echo  /scripts/adblock.sh on ran >> /tmp/adblock.log
          ;;
        "off")
          disableadblock
          echo  /scripts/adblock.sh off ran >> /tmp/adblock.log
      
          ;;
        *)
          echo "Run this with on or off as the parameter."
          exit 1
          ;;
      
      posted in Raspberry Pi
      Scott BartonS
      Scott Barton
    • RE: How do you install TRIGGERcmd on Raspberry pi with OpenWRT?

      @Russ said in How do you install TRIGGERcmd on Raspberry pi with OpenWRT?:

      pwd >> /tmp/pwd.log

      I put those lines in both my starttriggercmd script and my adblock script.

      When starting TRIGGERcmd automatically from the OpenWRT startup script I get the following for ENV:
      HLVL=3
      HOME=/
      TERM=linux
      PATH=/usr/sbin:/usr/bin:/sbin:/bin
      PWD=/

      When I then run disableadblock command using Alexa I get the following for ENV:
      SHLVL=5
      HOME=/
      NODE_TLS_REJECT_UNAUTHORIZED=0
      TERM=linux
      TCMD_COMPUTER_ID=5038e6811df15100191e57de
      PATH=/usr/sbin:/usr/bin:/sbin:/bin
      TCMD_COMMAND_ID=503962d2b77dfb0019ed137a
      PWD=/gitrepo/TRIGGERcmd-Agent/src

      If I then disable TRIGGERcmd from autostart and reboot and run it manually from SSH (FYI, I was within the /tmp directory when I ran it) I get the following for ENV:
      USER=root
      SHLVL=2
      HOME=/root
      OLDPWD=/root
      SSH_TTY=/dev/pts/0
      PS1=[\e]0;\u@\h: \w\a]\u@\h:\w$
      ENV=/etc/shinit
      VISUAL=nano
      LOGNAME=root
      TERM=xterm
      PATH=/usr/sbin:/usr/bin:/sbin:/bin:/scripts
      SHELL=/bin/ash
      PWD=/tmp
      EDITOR=nano

      And then when I run the disableadblocker script using Alexa I get:
      USER=root
      SSH_CLIENT=192.168.2.2 51955 22
      SHLVL=4
      HOME=/root
      OLDPWD=/root
      SSH_TTY=/dev/pts/0
      PS1=[\e]0;\u@\h: \w\a]\u@\h:\w$
      ENV=/etc/shinit
      VISUAL=nano
      NODE_TLS_REJECT_UNAUTHORIZED=0
      LOGNAME=root
      TERM=xterm
      TCMD_COMPUTER_ID=5038e6811df15100191e57de
      PATH=/usr/sbin:/usr/bin:/sbin:/bin:/scripts
      TCMD_COMMAND_ID=503962d2b77dfb0019ed137a
      SHELL=/bin/ash
      PWD=/gitrepo/TRIGGERcmd-Agent/src
      SSH_CONNECTION=192.168.2.2 51955 192.168.2.1 22
      EDITOR=nano

      posted in Raspberry Pi
      Scott BartonS
      Scott Barton
    • RE: How do you install TRIGGERcmd on Raspberry pi with OpenWRT?

      @Russ The log says it ran, but it doesn't do what it is supposed to do when the service is started automatically from the OpenWRT Local Startup script (/etc/rc.local). When I start the service from SSH using the exact same command that is in the startup script, it will run and do what it is supposed to do. However, if I close that SSH the service stops working. Both logs look exactly the same, but one actually executes and the other doesn't. I wonder if it is a permissions thing somehow?

      9bc5f411-c83d-4fa6-9221-3a371898c874-image.png

      ed93e998-dd07-4c75-84e6-efcc42537950-image.png

      posted in Raspberry Pi
      Scott BartonS
      Scott Barton
    • RE: How do you install TRIGGERcmd on Raspberry pi with OpenWRT?

      @Russ I have the ground set to background in the /root/.TRIGGERcmdData/commands.json file. I did actually try changing it to foreground to see if it would work, but did not so I switched it back.

      cc3bb1de-5a20-4665-b9f8-d646c8f7de04-image.png

      Thanks for your help!

      posted in Raspberry Pi
      Scott BartonS
      Scott Barton
    • RE: How do you install TRIGGERcmd on Raspberry pi with OpenWRT?

      @Russ I was able to get the service to start using OpenWRT. However when I use Alexa to issue commands, it says that it ran the command but doesn't seem to work (doesn't actually do what it was supposed to do). If I manually start the Triggercmd service from SSH and use Alexa to issue a command it works.

      89b67fd2-98af-4a69-8ceb-6a6cec9a4eff-image.png

      Here is the log:
      Thu Mar 4 10:36:23 2021 daemon.notice procd: /etc/rc.d/S95done: Running Linux daemon to run background tasks.
      Thu Mar 4 10:36:23 2021 daemon.notice procd: /etc/rc.d/S95done: Run installdaemon.sh to install the triggercmdagent daemon so it runs during boot
      Thu Mar 4 10:36:23 2021 daemon.notice procd: /etc/rc.d/S95done: Tokenfile: /root/.TRIGGERcmdData/token.tkn
      Thu Mar 4 10:36:23 2021 daemon.notice procd: /etc/rc.d/S95done: ComputerIDfile: /root/.TRIGGERcmdData/computerid.cfg
      Thu Mar 4 10:36:23 2021 daemon.notice procd: /etc/rc.d/S95done: Logging in with saved token to run background tasks.
      Thu Mar 4 10:36:24 2021 daemon.notice procd: /etc/rc.d/S95done: (node:3088) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
      Thu Mar 4 10:36:24 2021 daemon.notice procd: /etc/rc.d/S95done: (Use node --trace-warnings ... to show where the warning was created)
      Thu Mar 4 10:36:24 2021 daemon.notice procd: /etc/rc.d/S95done: Write backup completed.
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done:
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done:
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done: |> Now connected to https://www.triggercmd.com.
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done: ___/ For help, see: http://bit.ly/2q0QDpf
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done: (using sails.io.js node SDK @v1.2.1)
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done: Connected at: Thu Mar 04 2021 10:36:25 GMT-0500 (EST)
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done:
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done:
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done:
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done: Initiated command adds
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done: Initiated command removals
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done: { message: 'Subscribed to 5038e6811ca15100191cf7de!' }
      Thu Mar 4 10:36:25 2021 daemon.notice procd: /etc/rc.d/S95done: { message: 'Subscribed to 5038e6811ca15100191cf7de!' }
      Thu Mar 4 10:37:19 2021 daemon.notice procd: /etc/rc.d/S95done: { trigger: 'AdBlock', id: '503962d2b77e2b0019cf137a', params: 'off' }
      Thu Mar 4 10:37:19 2021 daemon.notice procd: /etc/rc.d/S95done: Running trigger: AdBlock Command: /scripts/adblock.sh off
      Thu Mar 4 10:37:20 2021 daemon.notice procd: /etc/rc.d/S95done: Reported: Command Ran

      posted in Raspberry Pi
      Scott BartonS
      Scott Barton
    • RE: How do you install TRIGGERcmd on Raspberry pi with OpenWRT?

      @Russ I can't get it to work. I created an initscript in /etc/init.d and and enabled it but can't seem to get it to work.

      #!/bin/sh /etc/rc.common

      START=35
      boot() {
      starttriggercmd
      }

      Also tried
      #!/bin/sh /etc/rc.common

      START=35
      start_service() {
      starttriggercmd
      }

      strarttriggercmd is a command I wrote to start the daemon.js and if I run it from the prompt it works. It basically just runs this:
      node /gitrepo/TRIGGERcmd-Agent/src/daemon.js --run /root/.TRIGGERcmdData

      posted in Raspberry Pi
      Scott BartonS
      Scott Barton
    • RE: How do you install TRIGGERcmd on Raspberry pi with OpenWRT?

      @Russ Having an installing and getting the daemon running.

      ran .src/installdaemon.sh and got installdaemon.sh not found even though I can see that it is there:
      ab775da9-b396-4e80-936f-970e3e4ff5a6-image.png

      I then opened installdaemon.sh to run the code manually. I verified that node.js is installed.
      3ae019db-56db-4dc0-9a76-db54187106ea-image.png

      So skipped that and then I ran the bottom section of code in installdaemon.sh and got the following errors:
      c94d6866-9f95-499c-88e3-b7cd03310e60-image.png

      systemctl and systemmd are not installed for OpenWRT.

      TIA.

      Scott

      posted in Raspberry Pi
      Scott BartonS
      Scott Barton
    • RE: Turn your VPN on/off

      For OpenWRT you can start the VPN interface with:
      ifup VPNInterfaceName

      And Stop it with:
      ifdown VPNInterfaceName

      More info:
      https://openwrt.org/docs/guide-user/base-system/basic-networking#network_management

      posted in Example Commands
      Scott BartonS
      Scott Barton
    • RE: How do you install TRIGGERcmd on Raspberry pi with OpenWRT?

      Also I can't find installdaemon.sh to get it to run in background on boot.

      posted in Raspberry Pi
      Scott BartonS
      Scott Barton