admin 管理员组文章数量: 888134
1. 自动挂载硬盘
-
使用
lsblk
命令查看磁盘设备 -
使用
blkid
命令查询硬盘的uuid -
创建挂载目录
mkdir -p /data
-
修改配置开机自动挂载
vim /etc/fstab
-
新增一行
UUID=f6e23bcb-983f-1d4e-bea1-36bae2a72c33 /data ext4 defaults 0 0
-
立即挂载
mount -a
2. 安装samba文件共享服务
- 使用
armbian-config
命令在软件中选中进行安装 - 修改配置文件
vim /etc/samba/smb.conf
,主要生效是_global_ 和最后一个_N1_,名字自定义
[global]
workgroup = root
server string = %h server
hosts allow = 192.168.2.
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
load printers = yes
printing = cups
printcap name = cups
min receivefile size = 16384
write cache size = 524288
getwd cache = yes
socket options = TCP_NODELAY IPTOS_LOWDELAY
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
public = yes
guest ok = yes
writable = no
printable = yes
printer admin = root
[print$]
comment = Printer Drivers
path = /etc/samba/drivers
browseable = yes
guest ok = no
read only = yes
write list = root
[N1]
comment = Storage
path = /data
writable = yes
public = no
valid users = root
force create mode = 0644
- 启动服务
systemctl start smbd.service
,开机自启systemctl enable smbd.service
- 添加账户密码,对应配置中的用户名
smbpasswd -a root
3. 安装qbittorrent下载服务
apt install qbittorrent-nox
- 添加到系统服务
vim /etc/systemd/system/qbittorrent-nox.service
[Unit]
Description=qBittorrent-nox
After=network.target
[Service]
User=root
Type=forking
RemainAfterExit=yes
ExecStart=/usr/bin/qbittorrent-nox -d
[Install]
WantedBy=multi-user.target
开机自启systemctl enable qbittorrent-nox.service
启动服务systemctl start qbittorrent-nox.service
- 默认web访问端口8080,用户名admin,密码adminadmin
4. 阿里云盘webdav
- 安装步骤
mkdir -p /home/aliyun-webdav
cd /home/aliyun-webdav
vim auto_update.sh
vim restart.sh
auto_update.sh
curl -G https://api2.pushdeer/message/push?pushkey...
为推送通知到手机的功能,需要的话可以研究一下开启。
#/usr/bin/bash
cd "$(dirname $0)"
#判断文件是否存在
if [[ -f "/usr/local/bin/aliyundrive-webdav" ]]; then
# 获取当前版本
current_version=`/usr/local/bin/aliyundrive-webdav --version|awk '{print $2}'`
if [[ -n $current_version ]];then
echo "[$(date '+%Y-%m-%d %H:%M:%S')]当前版本:$current_version"
else
echo "[$(date '+%Y-%m-%d %H:%M:%S')]获取当前版本失败!"
# curl -G "https://api2.pushdeer/message/push?pushkey=****************" --data-urlencode "text=aliyundrive-webdav获取当前版本失败!"
exit 1
fi
else
echo "[$(date '+%Y-%m-%d %H:%M:%S')]文件不存在,开始安装。"
current_version="None"
fi
# 通过官方api获取最新版本信息,messense/aliyundrive-webdav是用户名和仓库名
api_data=`curl -s https://api.github/repos/messense/aliyundrive-webdav/releases/latest`
# 获取版本信息tag_name
version=`echo "$api_data"|grep "tag_name"|awk -F "\"" '{ print $4 }'`
if [[ -z $version ]];then
echo "[$(date '+%Y-%m-%d %H:%M:%S')]获取最新版本号失败,请检查网络!"
# curl -G "https://api2.pushdeer/message/push?pushkey=*********************" --data-urlencode "text=aliyundrive-webdav获取最新版本号失败,请检查网络!"
exit 2
fi
echo "[$(date '+%Y-%m-%d %H:%M:%S')]最新版本:$version"
if [[ $version != *$current_version* ]];then
echo "[$(date '+%Y-%m-%d %H:%M:%S')]开始更新..."
rm -rf *.gz
# 获取下载链接
download=`echo "$api_data"|grep "browser_download_url"|grep "aarch64-unknown-linux-musl"|grep -v "sha256"|awk -F "\"" '{ print $4 }'`
echo $download
wget $download
tar -xzvf aliyundrive*.tar.gz
mv /usr/local/bin/aliyundrive-webdav "aliyundrive-webdav.$current_version"
mv aliyundrive-webdav /usr/local/bin/aliyundrive-webdav
chmod +x /usr/local/bin/aliyundrive-webdav
echo "[$(date '+%Y-%m-%d %H:%M:%S')]重启程序..."
echo "[$(date '+%Y-%m-%d %H:%M:%S')]已更新到$version版本"
# curl -G "https://api2.pushdeer/message/push?pushkey=**********************" --data-urlencode "text=aliyundrive-webdav已更新到$version"
else
echo "[$(date '+%Y-%m-%d %H:%M:%S')]已是最新版本。"
fi
sh restart.sh `cat refresh_token`
restart.sh
可根据自己需求修改启动参数
killall -9 aliyundrive-webdav
nohup /usr/local/bin/aliyundrive-webdav --auto-index --workdir /home/aliyun-webdav/ --port 9090 --auth-user admin --auth-password admin123098 --refresh-token $1 > /dev/null &
- 直接运行
auto_update.sh
会自动安装、重启,启动会失败,第一次启动需要手动获取token,执行脚本./restart.sh 获取的token
- 添加定时任务自动更新程序
crontab -e
0 5 * * * bash /home/aliyun-webdav/auto_update.sh >> /home/aliyun-webdav/update.log &
本文标签: 家庭 载机 Armbian webdav aliyun
版权声明:本文标题:N1 armbian打造家庭NAS、下载机、aliyun-webdav 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1725889601h887936.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论