Skip to content

Commit

Permalink
Merge pull request #26 from 007revad/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
007revad authored Sep 23, 2023
2 parents e606ace + 937f2ff commit 6745f59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 28 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.0.8
- Minor bug fix

v1.0.6
- Renamed to Synology_SHR_switch

Expand Down
34 changes: 6 additions & 28 deletions syno_shr_switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# sudo /volume1/scripts/syno_raidf1_shr_switch.sh
#------------------------------------------------------------------------------

scriptver="v1.0.6"
scriptver="v1.0.8"
script=Synology_RAID-F1_SHR_switch
repo="007revad/Synology_RAID-F1_SHR_switch"

Expand Down Expand Up @@ -161,7 +161,7 @@ scriptpath=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )


if ! printf "%s\n%s\n" "$tag" "$scriptver" |
sort --check --version-sort &> /dev/null ; then
sort --check=quiet --version-sort &> /dev/null ; then
echo -e "${Cyan}There is a newer version of this script available.${Off}"
echo -e "Current version: ${scriptver}\nLatest version: $tag"
if [[ -f $scriptpath/$script-$shorttag.tar.gz ]]; then
Expand Down Expand Up @@ -417,19 +417,8 @@ fi

# Enable RAID Group
if [[ $raidgrp == "yes" ]]; then
if [[ ! $settingraidgrp ]]; then
# Add supportraidgroup="yes"
echo 'supportraidgroup="yes"' >> "$synoinfo"
else
synosetkeyvalue "$synoinfo" "$srg" yes
fi

if [[ ! $settingshr ]]; then
# Add support_m2_pool="no"
echo 'support_m2_pool="no"' >> "$synoinfo"
else
synosetkeyvalue "$synoinfo" "$sshr" no
fi
synosetkeyvalue "$synoinfo" "$srg" yes
synosetkeyvalue "$synoinfo" "$sshr" no

# Check if we enabled RAID Group
settingshr="$(get_key_value $synoinfo ${sshr})"
Expand All @@ -444,19 +433,8 @@ fi

# Enable SHR
if [[ $shr == "yes" ]]; then
if [[ ! $settingshr ]]; then
# Add support_m2_pool="yes"
echo 'support_m2_pool="yes"' >> "$synoinfo"
else
synosetkeyvalue "$synoinfo" "$sshr" yes
fi

if [[ ! $settingshr ]]; then
# Add supportraidgroup="no"
echo 'supportraidgroup="no"' >> "$synoinfo"
else
synosetkeyvalue "$synoinfo" "$srg" no
fi
synosetkeyvalue "$synoinfo" "$srg" no
synosetkeyvalue "$synoinfo" "$sshr" yes

# Check if we enabled SHR
settingshr="$(get_key_value $synoinfo ${sshr})"
Expand Down

0 comments on commit 6745f59

Please sign in to comment.