Browse Source
Update syno_hdd_db.sh
Changed model detection method, again.
pull/14/head
007revad
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
17 deletions
-
syno_hdd_db.sh
|
|
@ -185,23 +185,9 @@ if [[ $dsm -gt "6" ]]; then |
|
|
version="_v$dsm" |
|
|
version="_v$dsm" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Get Synology model |
|
|
# Get Synology model from host db file |
|
|
model=$(cat /proc/sys/kernel/syno_hw_version) # not always the actual model number |
|
|
model=$(ls -lh /var/lib/disk-compatibility | grep -E ".*host(_v7)?\.db$" |\ |
|
|
|
|
|
rev | cut -d" " -f1 | rev | cut -d"_" -f1) |
|
|
modeltype=$(printf "%s" "$model" | sed 's/[0-9].*//') # DS, RS etc |
|
|
|
|
|
|
|
|
|
|
|
unique=$(get_key_value /etc/synoinfo.conf unique | cut -d'_' -f3) # 920+ etc |
|
|
|
|
|
|
|
|
|
|
|
# Remove extra text from end, like DS213pv10-j and DS1817+-j |
|
|
|
|
|
#[[ $model =~ ([0-9]{3,}) ]] && modelnum=${BASH_REMATCH[1]} |
|
|
|
|
|
[[ $model =~ ([0-9]{3,}(RP\+|RPxs|RP|\+II|xsII|xs\+|xs|\+|j|slim|play|se|air|D)?) ]] &&\ |
|
|
|
|
|
modelnum=${BASH_REMATCH[1]} |
|
|
|
|
|
|
|
|
|
|
|
if [[ $modelnum != "$unique" ]]; then |
|
|
|
|
|
model="$modeltype$unique" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
model=${model,,} # convert to lower case |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
|
|
#------------------------------------------------------------------------------ |
|
|
|