command line link/unlink
command line link/unlink
How does one link/unlink to a given reflector from the command line, please.
We have a need to cron this activity so that various regular nets can be heard.
Thank you.
We have a need to cron this activity so that various regular nets can be heard.
Thank you.
Re: command line link/unlink
Link to REF001 C
Unlink
Here is the full output from the command:
Hope that helps!
Code: Select all
sudo pistar-link ref001_c
Code: Select all
sudo pistar-link unlink
Code: Select all
pi-star@pi-star(ro):~$ sudo pistar-link
To unlink from any connected reflector, use: pistar-link unlink
To link to REF000 A for example, use: pistar-link ref000_a
If you need to make a reflector FIXED so that users cannot unlink,
for schedulling connections via CRON for example you can use the
the following: pistar-link ref000_a fixed
Should you wish to Un-Fix a reflector, relink to the same reflector
without the fixed flag, such as: pistar-link ref000_a
Re: command line link/unlink
Perfect, Andy, thank you.
Re: command line link/unlink
Somehow the command seems to have gotten broken. While linked to a reflector:
# pistar-link unlink
remotecontrold: no address, port, or password is set
In /etc/ircddbgateway, remoteEnabled=1 with an assigned port and password. Permissions on the files look correct:
# ls -l $(which pistar-link remotecontrold)
-r-xr-xr-x 1 root bin 869036 Aug 2 2016 /usr/local/bin/remotecontrold
-rwxr-xr-x 1 root staff 1823 Mar 7 2018 /usr/local/sbin/pistar-link
... yet we're unable to unlink from the startup reflector or link to any other, using either the command line or the Admin web page. Any suggestions, please?
# pistar-link unlink
remotecontrold: no address, port, or password is set
In /etc/ircddbgateway, remoteEnabled=1 with an assigned port and password. Permissions on the files look correct:
# ls -l $(which pistar-link remotecontrold)
-r-xr-xr-x 1 root bin 869036 Aug 2 2016 /usr/local/bin/remotecontrold
-rwxr-xr-x 1 root staff 1823 Mar 7 2018 /usr/local/sbin/pistar-link
... yet we're unable to unlink from the startup reflector or link to any other, using either the command line or the Admin web page. Any suggestions, please?
Re: command line link/unlink
That date stamp for pistar-link may be of concern...
... though the size looks the same...
Code: Select all
pi-star@pi-star-3b(ro):~$ ls -l $(which pistar-link remotecontrol remotecontrold)
-r-xr-xr-x 1 root bin 2354276 Aug 2 2016 /usr/local/bin/remotecontrol
-r-xr-xr-x 1 root bin 869036 Aug 2 2016 /usr/local/bin/remotecontrold
-rwxr-xr-x 1 root staff 1823 Jul 13 13:59 /usr/local/sbin/pistar-link
pi-star@pi-star-3b(ro):~$
--
AF6VN
Dennis L Bieber
Re: command line link/unlink
AF6VN thank you much, yes, ours is outdated relative to yours, despite the daily cron update and a manual pistar-{update,upgrade} since your reply. Here's the text of our pistar-link, and does that agree with yours, please:
# #
# Make it simple to link reflectors from the CLI on Pi-Star. #
# Origional suggestion by Adrian (VK4TUX) #
# #
##############################################################################
#
if [ "$(id -u)" != "0" ]; then
echo -e "You need to be root to run this command...\n"
exit 1
fi
# Setup some variables
cmd=/usr/local/bin/remotecontrold
module=$(grep -m 1 'callsign=' /etc/dstarrepeater | awk -F "=" '/callsign/ {print $2}')
if [ -z "$1" ]
then
echo "To unlink from any connected reflector, use: pistar-link unlink"
echo "To link to REF000 A for example, use: pistar-link ref000_a"
echo ""
echo "If you need to make a reflector FIXED so that users cannot unlink,"
echo "for schedulling connections via CRON for example you can use the"
echo "the following: pistar-link ref000_a fixed"
echo "Should you wish to Un-Fix a reflector, relink to the same reflector"
echo "without the fixed flag, such as: pistar-link ref000_a"
echo ""
exit 0
fi
if [ -z "$2" ]
then
relink=never
else
relink=${2}
fi
case ${1} in
*unlink)
${cmd} "${module}" unlink
exit 0
;;
*)
${cmd} "${module}" link ${relink} $1
exit 0
;;
esac
exit 0
# #
# Make it simple to link reflectors from the CLI on Pi-Star. #
# Origional suggestion by Adrian (VK4TUX) #
# #
##############################################################################
#
if [ "$(id -u)" != "0" ]; then
echo -e "You need to be root to run this command...\n"
exit 1
fi
# Setup some variables
cmd=/usr/local/bin/remotecontrold
module=$(grep -m 1 'callsign=' /etc/dstarrepeater | awk -F "=" '/callsign/ {print $2}')
if [ -z "$1" ]
then
echo "To unlink from any connected reflector, use: pistar-link unlink"
echo "To link to REF000 A for example, use: pistar-link ref000_a"
echo ""
echo "If you need to make a reflector FIXED so that users cannot unlink,"
echo "for schedulling connections via CRON for example you can use the"
echo "the following: pistar-link ref000_a fixed"
echo "Should you wish to Un-Fix a reflector, relink to the same reflector"
echo "without the fixed flag, such as: pistar-link ref000_a"
echo ""
exit 0
fi
if [ -z "$2" ]
then
relink=never
else
relink=${2}
fi
case ${1} in
*unlink)
${cmd} "${module}" unlink
exit 0
;;
*)
${cmd} "${module}" link ${relink} $1
exit 0
;;
esac
exit 0
Re: command line link/unlink
Well, the actual shell script looks similar, but the opening comments are different... Or you failed to copy the entire script.
Code: Select all
cat /usr/local/sbin/pistar-link
#!/bin/bash
#
##############################################################################
# #
# Pi-Star ircDDBGateway link Tool #
# #
# Version 1.0, Code, Design and Development by Andy Taylor (MW0MWZ). #
# #
# Make it simple to link reflectors from the CLI on Pi-Star. #
# Origional suggestion by Adrian (VK4TUX) #
# #
##############################################################################
#
if [ "$(id -u)" != "0" ]; then
echo -e "You need to be root to run this command...\n"
exit 1
fi
# Setup some variables
cmd=/usr/local/bin/remotecontrold
module=$(grep -m 1 'callsign=' /etc/dstarrepeater | awk -F "=" '/callsign/ {print $2}')
if [ -z "$1" ]
then
echo "To unlink from any connected reflector, use: pistar-link unlink"
echo "To link to REF000 A for example, use: pistar-link ref000_a"
echo ""
echo "If you need to make a reflector FIXED so that users cannot unlink,"
echo "for schedulling connections via CRON for example you can use the"
echo "the following: pistar-link ref000_a fixed"
echo "Should you wish to Un-Fix a reflector, relink to the same reflector"
echo "without the fixed flag, such as: pistar-link ref000_a"
echo ""
exit 0
fi
if [ -z "$2" ]
then
relink=never
else
relink=${2}
fi
case ${1} in
*unlink)
${cmd} "${module}" unlink
exit 0
;;
*)
${cmd} "${module}" link ${relink} $1
exit 0
;;
esac
exit 0
pi-star@pi-star-3b(ro):~$
--
AF6VN
Dennis L Bieber
Re: command line link/unlink
HI, for the not so savvy Linux guy (me). How do a write a CRON to do the following:
Link to 24 C on startup (that was easy)
Monday at 19:59 unlink 24 C
Monday at 20:00 link 24 A
Monday at 20:59 unlink 24 A
Monday at 21:00 link 24 C
Examples would be welcome, thank you
Link to 24 C on startup (that was easy)
Monday at 19:59 unlink 24 C
Monday at 20:00 link 24 A
Monday at 20:59 unlink 24 A
Monday at 21:00 link 24 C
Examples would be welcome, thank you