Fix globbing and other legacy problems
This commit is contained in:
parent
e4e6079a0b
commit
d144bdad75
2 changed files with 21 additions and 21 deletions
14
iscsi_fix.sh
14
iscsi_fix.sh
|
@ -5,22 +5,22 @@
|
|||
echo "Activating iSCSI share rebuilder"
|
||||
echo "Querying readynasd for list of volumes..."
|
||||
x=$(rn_nml -g volumes | grep "resource-id" | sed 's/^.*id="//;s/".*//;')
|
||||
number=$(echo $x | wc -w)
|
||||
number=$(echo "$x" | wc -w)
|
||||
echo "$number volume(s) found."
|
||||
for volume in ${x}
|
||||
do
|
||||
echo -n "Investigating volume /$volume..."
|
||||
for i in `find /"$volume" -maxdepth 2 -type d -name ".iscsi" | sed "s/\/.iscsi//g;s/\/$volume\///g;"`
|
||||
for i in $(find /"$volume" -maxdepth 2 -type d -name ".iscsi" | sed "s/\/.iscsi//g;s/\/$volume\///g;")
|
||||
do
|
||||
found=1
|
||||
path="/$volume/._share/${i}"
|
||||
echo "Found /$volume/${i}... recreating configs...".
|
||||
mkdir -p $path
|
||||
cat > $path/iscsi.conf << EOF
|
||||
mkdir -p "$path"
|
||||
cat > "$path"/iscsi.conf << EOF
|
||||
comment
|
||||
alert_threshold 80
|
||||
EOF
|
||||
cat > $path/custom_snapshot_management.conf << EOF
|
||||
cat > "$path"/custom_snapshot_management.conf << EOF
|
||||
enabled = no
|
||||
retention_rule = lifetime
|
||||
lifetime = 2592000
|
||||
|
@ -28,7 +28,7 @@ number = 30
|
|||
nonempty_snapshots = yes
|
||||
prev_versions = no
|
||||
EOF
|
||||
cat > $path/custom_snapshot_schedule.conf << EOF
|
||||
cat > "$path"/custom_snapshot_schedule.conf << EOF
|
||||
........................
|
||||
........................
|
||||
........................
|
||||
|
@ -37,7 +37,7 @@ EOF
|
|||
........................
|
||||
........................
|
||||
EOF
|
||||
cat > $path/snapshot.conf << EOF
|
||||
cat > "$path"/snapshot.conf << EOF
|
||||
0 0 0 * 0 0 0
|
||||
EOF
|
||||
echo " Done with /$volume/${i}."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue