Browse Source
Update syno_hdd_db.sh
Made drive_db_test_url code more robust
pull/15/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
2 additions and
2 deletions
-
syno_hdd_db.sh
|
|
@ -430,11 +430,11 @@ fi |
|
|
url=$(get_key_value "$file" drive_db_test_url) # returns a linefeed if key doesn't exist |
|
|
url=$(get_key_value "$file" drive_db_test_url) # returns a linefeed if key doesn't exist |
|
|
if [[ ! $url ]]; then |
|
|
if [[ ! $url ]]; then |
|
|
# Add drive_db_test_url=127.0.0.1 |
|
|
# Add drive_db_test_url=127.0.0.1 |
|
|
echo "drive_db_test_url=127.0.0.1" >> "$file" |
|
|
echo 'drive_db_test_url="127.0.0.1"' >> "$file" |
|
|
disabled="yes" |
|
|
disabled="yes" |
|
|
elif [[ $url != "127.0.0.1" ]]; then |
|
|
elif [[ $url != "127.0.0.1" ]]; then |
|
|
# Edit drive_db_test_url= |
|
|
# Edit drive_db_test_url= |
|
|
sed -i "s/drive_db_test_url=$url/drive_db_test_url=127.0.0.1/" "$file" |
|
|
sed -i "s/drive_db_test_url=.*/drive_db_test_url=\"127.0.0.1\"/" "$file" |
|
|
disabled="yes" |
|
|
disabled="yes" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|