Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
68
rated 0 times [  68] [ 0]  / answers: 1 / hits: 60609  / 3 Years ago, tue, may 4, 2021, 7:44:48

I often mount a remote drive using sshfs. I would love to have this mount automatically. However, if I mount it in my .bashrc or startup scripts, the mount often fails because my wireless internet connection has not yet been made.



Does anybody know of an easy way to execute a bash scrip every time the connection is made, or to auto-mount an sshfs drive?


More From » networking

 Answers
5

Add your script to /etc/network/if-up.d/.
Name your script without a '.sh' extension.



Also after adding script run chmod +x /etc/network/if-up.d/yourscriptname to give necessary permission.



Make sure the network interface (e.g. wlan0 or eth0) that should trigger your script when turned on is mentioned in the file /etc/network/interfaces.


[#32595] Tuesday, May 4, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
itchlos

Total Points: 486
Total Questions: 115
Total Answers: 110

Location: Macau
Member since Fri, Apr 28, 2023
1 Year ago
;