Portál AbcLinuxu, 29. listopadu 2025 09:36
#!/bin/sh
hostname="server"
hwaddr="fc:aa:11:11:dd:f8"
username="prs"
sharename="data"
sharepath="/media/data"
mountopts="-fstype=fuse,rw,nodev,noatime,allow_other,uid=1000,gid=1000,max_read=65536,IdentityFile=/home/prs/.ssh/id_rsa"
wolcmd="wol"
#test "$1" == "$sharename" || echo Exitting; exit 0
if ! ping "$hostname" -nqc1 > /dev/null 2>&1; then
$wolcmd "$hwaddr" > /dev/null
for n in `seq 1 120`; do
ping "$hostname" -nqc1 > /dev/null 2>&1 && break
sleep 1
done
fi
echo "$mountopts :sshfs\\#$username@$hostname\\:$sharepath"
[/etc/auto.master]
/media /etc/auto.sshfs --timeout=330,--ghost
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.