I have a hdd automount program written.
The software uses ssh in order to issue requests against the target machine.The Idea is that a newly installed hdd is automatically added to fstab.
I have gotten everything working to the point where the fstab line enty is ready to be appended to the file.
I am trying to append like this in my software:
command.RunCommandSudo($"echo \"{mountstring}\" >> /etc/fstab");
resulting in an ssh query of the following format:
sudo echo "UUID=X /mnt/test ext4 defaults 0 1" >> /etc/fstab
=> Permission denied
how would be an apropriate way? I doubt the apropriate way for an automated software would be to go through a text editor such as nano?