Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: QSO Recorder #3363

    is this the right repo? it hasnt been updated in a couple of years.

    htt ps:// github.com/OpenRepeater/openrepeater

    in reply to: How to rebuild config from CLI #3347

    I suppose the hipster use github.

    https://github.com/jm650/openrepeater

    in reply to: How to rebuild config from CLI #3348

    I suppose hipsters use github. Look ma, my first git.

    https://github.com/jm650/openrepeater

    in reply to: How to rebuild config from CLI #3349

    I think the site must filter our URLs. I have added this to github

    htt ps:// github.com/jm650/openrepeater

    thanks,
    j.

    in reply to: How to rebuild config from CLI #3345

    anyone following my foot steps should locate that cli script outside of the document root of the server otherwise someone might DoS your svxlink process by calling it over and over again.

    below is an a wrapper that handles the database updates and calls update_svxlink_cli.php

    I have been running it as root, but any user that can write openrepeater.db and restart processes with systemctl should be sufficient.

    here is the code for my wrapper

    — cut here —

    #!/bin/bash
    #
    # jason at broken.net
    # kid tested, and mother approved
    
    exitcode=1
    
    if [ $# -ne 1 ]; then
       if [ $# -gt 1 ]; then
          echo -e "too many arguments. $# is not 1. Please try again"
       fi
       echo -e "ie. $0 name_of_tone\n"
       echo -e "ie. $0 TelRing.wav\n"
       echo -e "valid tones are located in /var/lib/openrepeater/sounds/courtesy_tones. Take a look\n"
       exit $exitcode
    fi
    
    tone=$1
    
    if [ ! -e  "/var/lib/openrepeater/sounds/courtesy_tones/$tone" ]; then
       exitcode=$((Sum=$exitcode+1))
       echo "A courtesy tone by this name does not exist. Please check /var/lib/openrepeater/sounds/courtesy_tones for available tones."
       exit $exitcode
    fi
    
    echo update settings set value=\"$tone\" where keyID=\"courtesy\" | sqlite3 /var/lib/openrepeater/db/openrepeater.db
    
    php ./svxlink_update_cli.php
    if [ $? -eq 0 ]; then
       echo Successfully updated.
    else
       echo php returned an error. I did my best.
    fi
    in reply to: How to rebuild config from CLI #3341

    Okay, this seems to work…

    sqlite> select * from settings where keyID=’courtesy’;
    courtesy|_TelRing.wav
    sqlite> update settings set value=’_power-down.wav’ where keyID=’courtesy’;
    sqlite> select * from settings where keyID=’courtesy’;
    courtesy|_power-down.wav
    sqlite>
    root@openrepeater:/var/www/openrepeater/functions# php svxlink_update_cli.php

    Forgive my crude patch. My last php effort was almost 20 years ago. Is there a process to contribute?

    — cut here —

    root@openrepeater:/var/www/openrepeater/functions# diff svxlink_update.php svxlink_update_cli.php 
    11,16d10
    < /* SESSION CHECK TO SEE IF USER IS LOGGED IN. */
    < session_start();
    < if ((!isset($_SESSION['username'])) || (!isset($_SESSION['userID']))){
    < 	header('location: login.php');
    < } else { // If they are, show the page.
    < /* ---------------------------------------------------------- */
    27c21,28
    < require_once(rtrim($_SERVER['DOCUMENT_ROOT'], '/') . '/includes/autoloadClasses.php');
    ---
    > 
    > putenv("DOCUMENT_ROOT=/var/www/openrepeater");
    > require_once('/var/www/openrepeater/includes/autoloadClasses.php');
    > require_once('/var/www/openrepeater/includes/classes/Database.php');
    > require_once('/var/www/openrepeater/includes/classes/SVXLink.php');
    > require_once('/var/www/openrepeater/includes/classes/SVXLink_TCL.php');
    > require_once('/var/www/openrepeater/includes/classes/SVXLink_GPIO.php');
    > 
    190,202d190
    < /* WHAT PAGE TO GO BACK TO */
    < if (isset($_POST["return_url"])) {
    < 	// Return to page that sent here
    < 	$url = strtok($_POST["return_url"], '?'); //Clean parameters from URL
    < 	header('location: '.$url);	
    < } else if (isset($_SESSION["new_repeater_settings"])) {
    < 	// Wizard was run. Go ahead and destroy session and logout
    < 	session_destroy();
    < 	header('location: ../login.php');		
    < } else {
    < 	// Otherwise just go to dashboard
    < 	header('location: ../dashboard.php');	
    < }	
    205,210d192
    < <?php
    < /* ---------------------------------------------------------- */
    < // SESSION CHECK TO SEE IF USER IS LOGGED IN.
    <  } // close ELSE to end login check from top of page
    < /* ---------------------------------------------------------- */
    < ?>
    • This reply was modified 3 years, 9 months ago by Jason, KM6TMX.
    in reply to: How to rebuild config from CLI #3340

    Oh, maybe you provided the answer already in /var/www/openrepeater/functions/svxlink_update.php

    i will look at modifying that for CLI use.

    in reply to: How to rebuild config from CLI #3339

    Okay, I am cool restarting svxlink, for now. I see it as having to rarely restart it due to power outages. And I can put some hysteresis by waiting a few minutes before executing the change. If the power is not back within 20 minutes it is probably going to be out for hours.

    What I am missing is some glue code. I can update openrepeater.db easily enough, as I previously mentioned. The question really is, how do I execute the rebuild process to transfer the settings from openrepeater.db to the config files?

    The UI clearly does it at the push of a button. Can I execute the process some how with the scripts on hand? If not, which file(s) do this in the UI? Perhaps I can manipulate them to work from CLI.

    thanks,
    j.

Viewing 8 posts - 1 through 8 (of 8 total)