Yokemate of Keyboards
Posts: 2101 from 2003/2/24
From: po-RNO
...but if insecure options are fine (you're just using these in your own LAN), then there are options.
Installing a telnetd should work for a primitive remote shell on the machine. I don't remember if there are MorphOS native telnetd programs, but 68k ones should work as well.
Or if you just want to launch certain commands on the remote machine and don't need the whole shell, then you can put an entry or entries to inetd, and make that launch the commands you want when you trigger it by connecting into a defined port.
For example, I have one MorphOS Mac mini, which I use at parties to show an infoscreen, game competition results screen, and play music etc. I just connect it to a display and network, but don't use any keyboard or mouse in it, but control it via network with simple commands from another computer(s).
On that remote Mac mini I basically have just configured inetd to launch a simple shell script (called "mosctrl") when I connect to a certain port on that machine via telnet or any other mean that outputs to a network port. I have configured it by this way:
1) The wanted port (7979 in this case) is defined in ENVARC:sys/net/services: "mosctrl 7979/tcp"
2) Then the script is defined in ENVARC:sys/net/inetd.conf: "mosctrl stream tcp dos bin - execute S:mosctrl ?"
The actual script is placed in S:mosctrl, here's a part of it to get an impression. You can do pretty much anything in it:
Code:
.KEY COMMAND/A,DO/F
If "<COMMAND>" EQ "reboot"
Reboot
EndIf
If "<COMMAND>" EQ "shutdown"
Shutdown
EndIf
If "<COMMAND>" EQ "pause"
MOSSYS:C/LuaX S:MultiMeedio.lua Pause
Quit
EndIf
If "<COMMAND>" EQ "next"
MOSSYS:C/LuaX S:MultiMeedio.lua Next
Quit
EndIf
If "<COMMAND>" EQ "info"
Echo "*E[1mArtist: " NOLINE
RXCmd JUKEBOX "GET ARTIST"
Echo "Song: " NOLINE
RXCmd JUKEBOX "GET TITLE"
Echo "Album: " NOLINE
RXCmd JUKEBOX "GET ALBUM"
Echo "*E[0m" NOLINE
Quit
EndIf
If "<COMMAND>" EQ "quit"
RXCmd SAKUINFO QUIT
Quit
EndIf
If "<COMMAND>" EQ "tulos"
Run >NIL: Hollywood:System/Hollywood -quiet Work:Temp/Tulosruutu/TulosScreen.hws
Quit
EndIf
If "<COMMAND>" EQ "sakuinfo"
Run >NIL: Hollywood:System/Hollywood -quiet Work:Temp/SakuInfo/SakuInfo.hws
Quit
EndIf
If "<COMMAND>" EQ "tulosupdate"
RXCmd SAKUINFO UPDATE
Quit
EndIf
Then I can just telnet to the remote machine to the port 7979 from other machines to launch the commands... or what I actually use, is to make premade commands with the Echo command to control the remote machine.
I have made a whole new Ambient menu with CRABUM to control the remote machine, so I just select the wanted commands from a pull-down menu and don't need to type or remember anything.
For example, typing this in the shell would reboot the remote machine:
Echo "reboot" > TCP:remotemac/7979
In CRABUM I use this line for the same:
Run >NIL: Echo *"reboot*" > TCP:remotemac/mosctrl
And of course the previous script could be changed to launch any command you enter into it, but I didn't dare to allow that to avoid accidents :)
[ Edited by jPV 18.11.2018 - 17:19 ]