This website requires JavaScript.
0
Issues
Pull Requests
Milestones
Explore
0
Create…
New Repository
New Migration
New Organization
admin
Signed in as
admin
Profile
Starred
Subscriptions
Settings
Help
Site Administration
Sign Out
admin
/
homelab
Watching
1
Participating and mentions
Receive notifications from this repository when participating or mentioned.
All activity
Receive notifications for all events.
Ignore
Never receive notifications from this repository.
Custom
Select events you want to be notified of, in addition to participating and mentions.
Star
0
Fork
0
Notifications
Issues
Pull Requests
Releases
Cancel
Confirm
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Settings
Files
homelab
/
scripts
/
or
Cancel
Edit File
Preview
Preview Changes
Spaces
Tabs
2
4
8
Wrap
No wrap
#!/usr/bin/env bash # ============================================================================== # mount-zspace.sh # 用途:在 Mac mini 上自动挂载极空间 Z4 (192.168.31.185) 的 SMB 共享目录并保持断线自动重连 # 挂载点:~/nas/共享文件 & ~/nas/个人空间 # ============================================================================== set -euo pipefail NAS_IP="192.168.31.185" if [ -f "$HOME/homelab/.env" ]; then # shellcheck disable=SC1091 source "$HOME/homelab/.env" fi NAS_BASE="$HOME/nas" mkdir -p "$NAS_BASE/共享文件" "$NAS_BASE/个人空间" # 检查极空间是否在线 if ! ping -c 1 -W 1000 "$NAS_IP" >/dev/null 2>&1; then exit 0 fi # 1. 挂载「共享文件」(%E5%85%B1%E4%BA%AB%E6%96%87%E4%BB%B6) if ! mount | grep -q "$NAS_BASE/共享文件"; then mount_smbfs "//${SMB_USER}:${SMB_PASS}@${NAS_IP}/%E5%85%B1%E4%BA%AB%E6%96%87%E4%BB%B6" "$NAS_BASE/共享文件" 2>/dev/null || true fi # 2. 挂载「185XXXX1015」(个人空间) if ! mount | grep -q "$NAS_BASE/个人空间"; then mount_smbfs "//${SMB_USER}:${SMB_PASS}@${NAS_IP}/185XXXX1015" "$NAS_BASE/个人空间" 2>/dev/null || true fi
Commit Changes
Add a Signed-off-by trailer by the committer at the end of the commit log message.
Commit directly to the
main
branch.
Create a
new branch
for this commit and start a pull request.
Commit Changes
Cancel