lmkelly / Autoguard

Wireguard Automated
3 stars 0 forks source link

Task #2 - Implementing chosen method of transit #25

Open lmkelly opened 3 years ago

lmkelly commented 3 years ago

Finding a practical way to send the config data from the back end to the front end

lmkelly commented 3 years ago

Looking into the use of osticket plugins to allow the email attachments to be accessed through the file system.

lmkelly commented 3 years ago

https://github.com/osTicket/osTicket/issues/1243

lmkelly commented 3 years ago

It was super easy to install but when it puts the files into the folder it puts them into folders named after the first character of the random hash that is assigned to the file name. In an ideal world I would be able to find a way to change the plugin to set the file names to the name of the attachment as it's sent into osticket, but for now I'm going to try to just get rid of the folders and that way my monitor script on the backend will work.

lmkelly commented 3 years ago

It's proving extremely difficult to modify the plugin in any way and test whether or not it works without messing up my osTicket so I've posted a thread on their forums to see what steps I take next.

https://forum.osticket.com/d/99044-storage-fs-tweaking

lmkelly commented 3 years ago

I haven't gotten any replies and I don't feel like messing around with that plugin anymore, so I'm going to write a bash script to accommodate the weird output format.

lmkelly commented 3 years ago

going to be using this bash module https://linux.die.net/man/1/inotifywait

lmkelly commented 3 years ago

just got the script officially working https://github.com/lmkelly/Capstone/blob/master/back_end2

lmkelly commented 3 years ago

resources used: https://stackoverflow.com/questions/229551/how-to-check-if-a-string-contains-a-substring-in-bash https://stackoverflow.com/questions/20360151/using-if-within-a-while-loop-in-bash https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_09_02.html https://unix.stackexchange.com/questions/132763/inotifywait-different-action-on-file-or-dir https://ryanstutorials.net/bash-scripting-tutorial/bash-if-statements.php