How Termius Detects the Server's OS How Termius Detects the Server's OS

How Termius Detects the Server's OS

Dmitry Machulo Dmitry Machulo

To detect the OS installed on a server, Termius executes a script. It happens when the connection is being established (in the exec channel) and if Termius hasn't already identified the OS. Having found out the OS installed on a server, Termius can display the logo of the OS next to the host name in the interface, instead of a generic icon.

The information about OSes is synchronized across all devices (requires a Pro or Teams account).

OS detection can be enabled or disabled in the settings, and is enabled by default. Disabling OS detection will not cause the logos of detected OSes to disappear.

Note: A server may return information about the installed OS during connection process / handshake. Termius will use that information to show the OS logo, even when OS detection is disabled.

OS detection algorithm

Before Termius executes a script to detect OS, it finds out which shell runs on the server, which is done like so:

echo $SHELL
exit;

If the above script doesn't return an error, Termius runs one of the scripts below, depending on the shell being used on the server.

if set name (uname) = "Linux"
cat /etc/*release
else
uname
end
HISTFILE=;
SA_OS_TYPE="Linux"
REAL_OS_NAME=`uname`
if [ "$REAL_OS_NAME" != "$SA_OS_TYPE" ] ;
then
echo `uname`
else
DISTRIB_ID=\"`cat /etc/*release`\"
echo $DISTRIB_ID;
fi;
exit;

If any of the scripts mentioned in this section returned an error, Termius checks whether or not RouterOS is installed on the server:

:put [/system resource get platform]

Turn OS detection on or off

  1. In Preferences, open the Terminal page.
  2. Check or uncheck Detect OS.
  1. Go to Settings.
  2. Check or uncheck Detect Host Operating System.
  1. Go to Settings.
  2. Check or uncheck Detect OS.

Was this article helpful?

0 out of 2 found this helpful

Add comment

Please sign in to leave a comment.