fjueic / gsconnect-mount-manager

MIT License
24 stars 1 forks source link

Clean up the script, Update some logic, and add output for the user #1

Closed SwayKh closed 9 months ago

SwayKh commented 9 months ago

Remove the need to run the whole script as sudo update the extension directory check logic Also added some echo outputs for the user to see the steps and removed redundant variables and imports

fjueic commented 9 months ago

in install.sh line 40 will need root previlage. You can either just add sudo. or selectively give root privilegesbased on the extension installation location.

and this hardcoded path needs to change you can pass the some argument to handle it. I was not able to install if extension was installed as system extenion in /usr directory

if you are using python shebang, do you not need to run chmod +x script ? and in your change install.sh as whole script dont require root previlage. so enableService.sh can be merge with install.sh

SwayKh commented 9 months ago

I fixed the issue on Line 40, in install.sh, just added the sudo, checking the extension directory to run sudo cp is unnecessarily complicated for it.

Also updated the hardcoded path in update_sftp.py, please be sure to go over it as I am not completely confident with the solution, but it should work I think.

Although the script should be able to edit files in /usr directory since it's being run with sudo, I am not sure what the issue was, Can you test it again to be sure?.

Using the shebang just removes the need to run the script with sudo python ./script.py , instead we can just use sudo ./script.py and bash should run it with python3. We don't need the chmod +x script since we can just upload the script with the executable permission applied.

Also moved ./enableservice code to install.sh as you requested. Please remove unnecessary files and update the README.md with new solution