mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-10 09:35:58 +02:00
Update 00-smb_mounts.sh
https://github.com/alexbelgium/hassio-addons/issues/1120
This commit is contained in:
@@ -10,7 +10,7 @@ set -e
|
|||||||
if bashio::config.has_value 'networkdisks'; then
|
if bashio::config.has_value 'networkdisks'; then
|
||||||
|
|
||||||
# Alert message that it is a new code
|
# Alert message that it is a new code
|
||||||
if [[ "$(date +"%Y%m%d")" -lt "20240101" ]]; then
|
if [[ "$(date +"%Y%m%d")" -lt "20240201" ]]; then
|
||||||
bashio::log.warning "------------------------"
|
bashio::log.warning "------------------------"
|
||||||
bashio::log.warning "This is a new code, please report any issues on https://github.com/alexbelgium/hassio-addons"
|
bashio::log.warning "This is a new code, please report any issues on https://github.com/alexbelgium/hassio-addons"
|
||||||
bashio::log.warning "------------------------"
|
bashio::log.warning "------------------------"
|
||||||
@@ -87,7 +87,7 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
&& MOUNTED=true && MOUNTOPTIONS="$SMBVERS$SECVERS$PUID$PGID$CHARSET$DOMAIN" || MOUNTED=false
|
&& MOUNTED=true && MOUNTOPTIONS="$SMBVERS$SECVERS$PUID$PGID$CHARSET$DOMAIN" || MOUNTED=false
|
||||||
|
|
||||||
# Deeper analysis if failed
|
# Deeper analysis if failed
|
||||||
if [ "$MOUNTED" = false ]; then
|
if [ "$MOUNTED" = false ]; then
|
||||||
|
|
||||||
# Extract ip part of server for further manipulation
|
# Extract ip part of server for further manipulation
|
||||||
server="$(echo "$disk" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+")"
|
server="$(echo "$disk" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+")"
|
||||||
@@ -105,7 +105,7 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "... $server is reachable"
|
echo "... $server is confirmed reachable"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Are credentials correct
|
# Are credentials correct
|
||||||
@@ -128,7 +128,7 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
echo "... testing path"
|
echo "... testing path"
|
||||||
bashio::log.fatal "No shares found. Invalid or inaccessible SMB path?"
|
bashio::log.fatal "No shares found. Invalid or inaccessible SMB path?"
|
||||||
else
|
else
|
||||||
echo "... valid credentials"
|
echo "... credentials are valid"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Extracting SMB versions and normalize output
|
# Extracting SMB versions and normalize output
|
||||||
@@ -150,7 +150,7 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
SMBVERS="3.1.1"
|
SMBVERS="3.1.1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo "... SMB version $SMBVERS detected"
|
echo "... SMB version detected : $SMBVERS"
|
||||||
SMBVERS=",vers=$SMBVERS"
|
SMBVERS=",vers=$SMBVERS"
|
||||||
elif smbclient -t 2 -L "$server" -m NT1 -N $DOMAINCLIENT &>/dev/null; then
|
elif smbclient -t 2 -L "$server" -m NT1 -N $DOMAINCLIENT &>/dev/null; then
|
||||||
echo "... SMB version : only SMBv1 is supported, this can lead to issues"
|
echo "... SMB version : only SMBv1 is supported, this can lead to issues"
|
||||||
|
|||||||
Reference in New Issue
Block a user