Page 1 of 1

Is there a way to update FAHControl from CLI?

Posted: Mon Mar 30, 2020 6:02 pm
by psjrg
Hi

I'm trying to update FAHControl clients without the GUI. I did some googling and also looked at FAHControl on github but haven't been able to find any obvious answer. I'd like to be able to deploy FAHClients with a script and have it CRUD the client info in FAHControl.

Could anyone provide some insight on this? Perhaps a link that might get me started? Thanks in advance.

Re: Is there a way to update FAHControl from CLI?

Posted: Mon Mar 30, 2020 6:08 pm
by ipkh
What are you trying to update? The config.xml file is pretty standard layout and options. Your script could just replace it or edit it.

Re: Is there a way to update FAHControl from CLI?

Posted: Mon Mar 30, 2020 6:14 pm
by psjrg
I have config.xml pretty well figured out for deploying and configuring FAHClient on the remote machines. What I would like to do is be able to update the client info (IP/port) in FAHControl on my local machine for monitoring. Config.xml doesn't appear to contain the client information for FAHControl.

Re: Is there a way to update FAHControl from CLI?

Posted: Mon Mar 30, 2020 6:20 pm
by ipkh
I see, I'm sure there must be a file somewhere that houses that information. If you add multiple clients manually does it survive a reboot? Maybe there's a config file in the users home directory.

Re: Is there a way to update FAHControl from CLI?

Posted: Mon Mar 30, 2020 6:38 pm
by psjrg
It does survive a reboot, so it must be recorded or serialized somewhere. I just can't seem to find it.

Re: Is there a way to update FAHControl from CLI?

Posted: Mon Mar 30, 2020 6:39 pm
by ipkh
I'll do a double check on my system at home tonight.

Re: Is there a way to update FAHControl from CLI?

Posted: Mon Mar 30, 2020 6:46 pm
by psjrg
I think I found it using lsof. It appears to be a serialized data.data file. Not human readable though.

This is on MacOS. Its in the saved application state directory.

Re: Is there a way to update FAHControl from CLI?

Posted: Mon Mar 30, 2020 8:24 pm
by Joe_H
You can use telnet to connect to the running FAHClient, telnet to local address 127.0.0.1 over port 36330. I have done this in the past, but it appears Apple has removed telnet from the available utilities for the CLI. There may be a replacement you can install. As best as I can tell the removal was with High Sierra.

Once connected to FAHClient there is a help command available, you should be able to make and save changes.

The user storable changes are kept in config.xml.

(Dang it, I just had to upgrade my laptop to HS for VPN and Remote Desktop for work from home :cry: )

Re: Is there a way to update FAHControl from CLI?

Posted: Mon Mar 30, 2020 9:02 pm
by psjrg
Thanks Joe. I do have telnet through homebrew.

The commands seem related to FAHClient on the local machine. I was hoping to be able to update the client list in FAHControl for newly deployed instances or updating for IP changes. Is there a specific command you could point.

Bascially the script I'd like to make would run from the local machine and do the following to a list of remote machines:
>log into remote machine
>download FAHClient Package
>deploy custom config.xml
>restart FAHClient
>open firewall ports
>add client to FAHControl on the local machine

Its really just the last step that I'm asking about. I don't want to manually add the remote machines to the client list in FAHControl for each remote machine. Its probably the most trivial step but would help with organization.

I hope I am explaining this in a way that makes sense.

Screenshot below of the panel I'm trying to update:
https://imgur.com/a/1K9qcWI

Re: Is there a way to update FAHControl from CLI?

Posted: Tue Mar 31, 2020 12:19 am
by ipkh
The Fahcontrol uses a SQL database stored in the .FAHClient directory of the users home directory. There is a simple clients entry with 3 data points name,ip address and password.

Re: Is there a way to update FAHControl from CLI?

Posted: Tue Mar 31, 2020 12:54 am
by psjrg
ipkh wrote:The Fahcontrol uses a SQL database stored in the .FAHClient directory of the users home directory. There is a simple clients entry with 3 data points nane,up address and password.
Wow thanks! I found it. For anyone on macOS: /Users/<username>/Library/Application\ Support/FAHClient/FAHControl.db