admin管理员组

文章数量:1602097

1. 自动挂载硬盘

  1. 使用lsblk命令查看磁盘设备

  2. 使用blkid命令查询硬盘的uuid

  3. 创建挂载目录mkdir -p /data

  4. 修改配置开机自动挂载vim /etc/fstab

  5. 新增一行UUID=f6e23bcb-983f-1d4e-bea1-36bae2a72c33 /data ext4 defaults 0 0

  6. 立即挂载mount -a

2. 安装samba文件共享服务

  1. 使用armbian-config命令在软件中选中进行安装
  2. 修改配置文件 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
  1. 启动服务systemctl start smbd.service,开机自启systemctl enable smbd.service
  2. 添加账户密码,对应配置中的用户名smbpasswd -a root

3. 安装qbittorrent下载服务

  1. apt install qbittorrent-nox
  2. 添加到系统服务 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

  1. 默认web访问端口8080,用户名admin,密码adminadmin

4. 阿里云盘webdav

  1. 安装步骤
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 &

  1. 直接运行auto_update.sh会自动安装、重启,启动会失败,第一次启动需要手动获取token,执行脚本./restart.sh 获取的token
  2. 添加定时任务自动更新程序crontab -e
0 5 * * * bash /home/aliyun-webdav/auto_update.sh >> /home/aliyun-webdav/update.log &

本文标签: 家庭载机Armbianwebdavaliyun