Add sshfs setup
parent
a56db9263f
commit
ac56f85dfd
@ -1 +0,0 @@
|
||||
kuba@bazzite.6047:1784385156
|
||||
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
ssh_path=$1 # like kuba@192.168.1.90:/mnt/hdd
|
||||
mount_path=$2 # like /var/mnt/hdd
|
||||
service_name=$(echo "$mount_path" | sed 's/\//-/g');
|
||||
service_name="${service_name:1}"
|
||||
|
||||
echo $service_name;
|
||||
exit
|
||||
sudo tee "/etc/systemd/system/${service_name}.mount" <<EOF
|
||||
[Unit]
|
||||
Description=SSHFS Mount for $ssh_path
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Mount]
|
||||
What=$ssh_path
|
||||
Where=$mount_path
|
||||
Type=fuse.sshfs
|
||||
Options=IdentityFile=/root/.ssh/id_ed25519,allow_other,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3
|
||||
TimeoutSec=30
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
EOF
|
||||
Loading…
Reference in New Issue