mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-09 15:31:00 +02:00
allow mount by label
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
- Allow mounting local drives by label. Just pust the label instead of sda1 for example
|
||||
|
||||
## 14.3.9.99202110311443-7435-01519b5e7ubuntu20.04.1-ls159 (31-10-2021)
|
||||
|
||||
- Update to latest version from linuxserver/docker-qbittorrent
|
||||
- Improve SMB mount code to v1.5 ; accepts several network disks separated by commas (//123.12.12.12/share,//123.12.12.12/hello) that are mount to /mnt/$sharename
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ Username: "admin" #username to access webui. Please change it as the default is
|
||||
customUI: selection from list # alternative webUI can be set here. Latest version set at each addon start.
|
||||
DNS_servers : 8.8.8.8,1.1.1.1 # Keep blank to use router’s DNS, or set custom DNS to avoid spamming in case of local DNS ad-remover
|
||||
SavePath: "/share/qbittorrent" # Define the download directory
|
||||
localdisks: "sda1" # Optional
|
||||
localdisks: sda1 #put the hardware name of your drive to mount separated by commas, or its label. Ex: sda1, sdb1, MYNAS...
|
||||
networkdisks: "//SERVER/SHARE" # optional, list of smb servers to mount, separated by commas
|
||||
cifsusername: "username" # optional, smb username, same for all smb shares
|
||||
cifspassword: "password" # optional, smb password
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
# MOUNT LOCAL SHARES #
|
||||
######################
|
||||
|
||||
|
||||
|
||||
# Mount local Share if configured
|
||||
if bashio::config.has_value 'localdisks'; then
|
||||
|
||||
@@ -14,10 +12,21 @@ if bashio::config.has_value 'localdisks'; then
|
||||
|
||||
# Separate comma separated values
|
||||
for disk in ${MOREDISKS//,/ }; do
|
||||
# Mount each disk
|
||||
|
||||
# Mount by device as default
|
||||
devpath=/dev
|
||||
|
||||
# Mount as label
|
||||
[ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label
|
||||
|
||||
# Creates dir
|
||||
mkdir -p /mnt/$disk
|
||||
chown -R $(id -u):$(id -g) /mnt/$disk
|
||||
[ -d /share/$disk ] && mount /dev/$disk /share/$disk || true
|
||||
mount /dev/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives!" && rmdir /mnt/$disk)
|
||||
# Legacy mounting : mount to share if still exists (avoid breaking changes)
|
||||
[ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true
|
||||
# Mount
|
||||
mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk)
|
||||
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user