master - lvmdump: replace individual redirects
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=030912ec03f4ad18743...
Commit: 030912ec03f4ad1874351dbfb2048fa73477d914
Parent: df57845f6141ac4b00e272229f65edd35912534c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 29 16:21:19 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200
lvmdump: replace individual redirects
Consider using { cmd1; cmd2; } >> file instead of individual redirects.
---
scripts/lvmdump.sh.in | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/scripts/lvmdump.sh.in b/scripts/lvmdump.sh.in
index 7ca7d0b..4bef7df 100644
--- a/scripts/lvmdump.sh.in
+++ b/scripts/lvmdump.sh.in
@@ -198,14 +198,16 @@ if (( clustered )); then
fi
myecho "Gathering LVM & device-mapper version info..."
-echo "LVM VERSION:" >> "$dir/versions"
-"$LVM" lvs --version >> "$dir/versions" 2>> "$log"
-echo "DEVICE MAPPER VERSION:" >> "$dir/versions"
-"$DMSETUP" --version >> "$dir/versions" 2>> "$log"
-echo "KERNEL VERSION:" >> "$dir/versions"
-"$UNAME" -a >> "$dir/versions" 2>> "$log"
-echo "DM TARGETS VERSIONS:" >> "$dir/versions"
-"$DMSETUP" targets >> "$dir/versions" 2>> "$log"
+{
+ echo "LVM VERSION:"
+ "$LVM" lvs --version
+ echo "DEVICE MAPPER VERSION:"
+ "$DMSETUP" --version
+ echo "KERNEL VERSION:"
+ "$UNAME" -a
+ echo "DM TARGETS VERSIONS:"
+ "$DMSETUP" targets
+} >> "$dir/versions" 2>> "$log"
myecho "Gathering dmsetup info..."
log "\"$DMSETUP\" info -c >> \"$dir/dmsetup_info\" 2>> \"$log\""
6 years, 9 months
master - lvmdump: drop useless cat
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=df57845f6141ac4b00e...
Commit: df57845f6141ac4b00e272229f65edd35912534c
Parent: a458065aa10c12f8a5c89ce7c6140c0459221f60
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 21:02:23 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200
lvmdump: drop useless cat
Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
---
scripts/lvmdump.sh.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/lvmdump.sh.in b/scripts/lvmdump.sh.in
index f5af242..7ca7d0b 100644
--- a/scripts/lvmdump.sh.in
+++ b/scripts/lvmdump.sh.in
@@ -295,7 +295,7 @@ if (( sysreport )); then
lvm2-activation-net.service \
> \"$sysreport_dir/systemd_lvm2_services_status\" 2>> \"$log\""
log "$SYSTEMCTL list-units -l -a --no-legend --no-pager > \"$sysreport_dir/systemd_unit_list\" 2>> \"$log\""
- for unit in $(cat "$sysreport_dir/systemd_unit_list" | "$GREP" lvm2-pvscan | cut -d " " -f 1); do
+ for unit in $("$GREP" lvm2-pvscan "$sysreport_dir/systemd_unit_list" | cut -d " " -f 1); do
log "$SYSTEMCTL status -l --no-pager -n $log_lines -o short-precise $unit >> \"$sysreport_dir/systemd_lvm2_pvscan_service_status\""
done
fi
6 years, 9 months
master - lvmdump: legacy syntax
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a458065aa10c12f8a5c...
Commit: a458065aa10c12f8a5c89ce7c6140c0459221f60
Parent: a0740f831c4787fbb98a9a7db5ca2f3c0bfdcf6d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 21:00:48 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200
lvmdump: legacy syntax
Use $(..) instead of legacy `..`.
---
scripts/lvmdump.sh.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/lvmdump.sh.in b/scripts/lvmdump.sh.in
index 611dda6..f5af242 100644
--- a/scripts/lvmdump.sh.in
+++ b/scripts/lvmdump.sh.in
@@ -98,7 +98,7 @@ while getopts :acd:hlpmus opt; do
esac
done
-NOW=`$DATE -u +%G%m%d%k%M%S | $TR -d ' '`
+NOW=$("$DATE" -u +%G%m%d%k%M%S | "$TR" -d ' ')
if test -n "$userdir"; then
dir="$userdir"
else
6 years, 9 months
master - lvmdump: drop extra $
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a0740f831c4787fbb98...
Commit: a0740f831c4787fbb98a9a7db5ca2f3c0bfdcf6d
Parent: e08e714b68cce5b46fe47af7716a6d5236f5c683
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 20:56:17 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200
lvmdump: drop extra $
$/${} is unnecessary on arithmetic variables.
---
scripts/lvmdump.sh.in | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/scripts/lvmdump.sh.in b/scripts/lvmdump.sh.in
index 143b819..611dda6 100644
--- a/scripts/lvmdump.sh.in
+++ b/scripts/lvmdump.sh.in
@@ -139,7 +139,7 @@ warnings
myecho "Creating dump directory: $dir"
echo " "
-if (( $advanced )); then
+if (( advanced )); then
myecho "Gathering LVM volume info..."
myecho " vgscan..."
@@ -158,7 +158,7 @@ if (( $advanced )); then
log "\"$LVM\" vgs -v >> \"$dir/vgs\" 2>> \"$log\""
fi
-if (( $clustered )); then
+if (( clustered )); then
myecho "Gathering cluster info..."
{
@@ -234,7 +234,7 @@ myecho "Gathering /sys/block listing..."
log "$LS -laR /sys/block >> \"$dir/sysblock_listing\" 2>> \"$log\""
log "$LS -laR /sys/devices/virtual/block >> \"$dir/sysblock_listing\" 2>> \"$log\""
-if (( $metadata )); then
+if (( metadata )); then
myecho "Gathering LVM metadata from Physical Volumes..."
log "$MKDIR -p \"$dir/metadata\""
@@ -252,7 +252,7 @@ if (( $metadata )); then
done
fi
-if (( $sysreport )); then
+if (( sysreport )); then
myecho "Gathering system info..."
sysreport_dir="$dir/sysreport"
@@ -301,7 +301,7 @@ if (( $sysreport )); then
fi
fi
-if (( $udev )); then
+if (( udev )); then
myecho "Gathering udev info..."
udev_dir="$dir/udev"
@@ -315,7 +315,7 @@ if (( $udev )); then
log "$CP -RL --preserve=all /lib/udev/rules.d \"$udev_dir/rules_lib\" 2>> \"$log\""
fi
-if (( $lvmetad )); then
+if (( lvmetad )); then
(echo 'request="dump"'; echo '##') | {
if type -p "$SOCAT" >& /dev/null; then
echo "$SOCAT unix-connect:$LVMETAD_SOCKET -" >> "$log"
@@ -331,7 +331,7 @@ if (( $lvmetad )); then
} > "$dir/lvmetad.txt"
fi
-if (( $lvmpolld )); then
+if (( lvmpolld )); then
(echo 'request="dump"'; echo '##') | {
if type -p "$SOCAT" >& /dev/null; then
echo "$SOCAT unix-connect:$LVMPOLLD_SOCKET -" >> "$log"
6 years, 9 months
master - lvmdump: replace printf
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e08e714b68cce5b46fe...
Commit: e08e714b68cce5b46fe47af7716a6d5236f5c683
Parent: e292c1a1cac4edc394fe9daa9ef11b691216740d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 20:54:00 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200
lvmdump: replace printf
Don't use variables in the printf format string. Use printf "..%s.." "$foo".
Advice replaced with plain 'echo'.
---
scripts/lvmdump.sh.in | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/scripts/lvmdump.sh.in b/scripts/lvmdump.sh.in
index 6744058..143b819 100644
--- a/scripts/lvmdump.sh.in
+++ b/scripts/lvmdump.sh.in
@@ -164,7 +164,8 @@ if (( $clustered )); then
{
for i in nodes status services; do
cap_i=$(echo $i|tr a-z A-Z)
- printf "$cap_i:\n----------------------------------\n"
+ echo "$cap_i:"
+ echo "----------------------------------"
log "cman_tool $i 2>> \"$log\""
echo
done
6 years, 9 months
master - lvmdump: double quote
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e292c1a1cac4edc394f...
Commit: e292c1a1cac4edc394fe9daa9ef11b691216740d
Parent: 6330e2dc8621e0383a5606acbfb9687a34f1a668
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 20:48:19 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200
lvmdump: double quote
Double quote to prevent globbing and word splitting.
---
scripts/lvmdump.sh.in | 52 ++++++++++++++++++++++++------------------------
1 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/scripts/lvmdump.sh.in b/scripts/lvmdump.sh.in
index 6467863..6744058 100644
--- a/scripts/lvmdump.sh.in
+++ b/scripts/lvmdump.sh.in
@@ -1,7 +1,7 @@
#!/bin/bash
# We use some bash-isms (getopts?)
-# Copyright (C) 2007-2015 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2007-2017 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
#
@@ -53,7 +53,7 @@ LVMPOLLD_SOCKET=${LVM_LVMPOLLD_SOCKET-/var/run/lvm/lvmpolld.socket}
die() {
code=$1; shift
echo "$@" 1>&2
- exit $code
+ exit "$code"
}
"$LVM" version >& /dev/null || die 2 "Could not run lvm binary '$LVM'"
@@ -106,12 +106,12 @@ else
dir="$HOME/$dirbase"
fi
-if test -d $dir ; then
- (shopt -s nullglob dotglob; test -r $dir -a -w $dir -a -x $dir && cd $dir && files=(*) && ((! ${#files[@]}))) || \
+if test -d "$dir" ; then
+ (shopt -s nullglob dotglob; test -r "$dir" -a -w "$dir" -a -x "$dir" && cd "$dir" && files=(*) && ((! ${#files[@]}))) || \
die 5 "Fatal: directory $dir already exists and is not empty or inaccessible"
else
- test -e $dir && die 3 "Fatal: $dir already exists"
- $MKDIR -p $dir || die 4 "Fatal: could not create $dir"
+ test -e "$dir" && die 3 "Fatal: $dir already exists"
+ "$MKDIR" -p "$dir" || die 4 "Fatal: could not create $dir"
fi
log="$dir/lvmdump.log"
@@ -193,7 +193,7 @@ if (( $clustered )); then
echo "MASTER:"
cat /debug/dlm/clvmd_master
fi
- } >> $dir/cluster_info
+ } >> "$dir/cluster_info"
fi
myecho "Gathering LVM & device-mapper version info..."
@@ -238,14 +238,14 @@ if (( $metadata )); then
log "$MKDIR -p \"$dir/metadata\""
- pvs="$("$LVM" pvs --separator , --noheadings --units s --nosuffix -o \
- name,pe_start 2>> "$log" | $SED -e 's/^ *//')"
+ pvs=$("$LVM" pvs --separator , --noheadings --units s --nosuffix -o \
+ name,pe_start 2>> "$log" | $SED -e 's/^ *//')
for line in $pvs
do
test -z "$line" && continue
- pv="$(echo $line | $CUT -d, -f1)"
- pe_start="$(echo $line | $CUT -d, -f2)"
- name="$($BASENAME "$pv")"
+ pv=$(echo "$line" | "$CUT" -d, -f1)
+ pe_start=$(echo "$line" | "$CUT" -d, -f2)
+ name=$("$BASENAME" "$pv")
myecho " $pv"
log "$DD if=$pv \"of=$dir/metadata/$name\" $DDFLAGS bs=512 count=$pe_start 2>> \"$log\""
done
@@ -257,21 +257,21 @@ if (( $sysreport )); then
sysreport_dir="$dir/sysreport"
log_lines=10000
- SYSTEMCTL=$(which systemctl 2>> $log)
- JOURNALCTL=$(which journalctl 2>> $log)
- LSBLK=$(which lsblk 2>> $log)
+ SYSTEMCTL=$(which systemctl 2>> "$log")
+ JOURNALCTL=$(which journalctl 2>> "$log")
+ LSBLK=$(which lsblk 2>> "$log")
log "$MKDIR -p \"$sysreport_dir\""
if test -z "LSBLK"; then
myecho "WARNING: lsblk not found"
else
- if $LSBLK --help | $GREP -- --output-all >/dev/null; then
+ if "$LSBLK" --help | "$GREP" -- --output-all >/dev/null; then
log "$LSBLK -O >> \"$sysreport_dir/lsblk_O\""
else
log "$LSBLK >> \"$sysreport_dir/lsblk\""
fi
- if $LSBLK --help | $GREP -- --inverse >/dev/null; then
+ if "$LSBLK" --help | "$GREP" -- --inverse >/dev/null; then
log "$LSBLK -s >> \"$sysreport_dir/lsblk_s\""
fi
fi
@@ -294,7 +294,7 @@ if (( $sysreport )); then
lvm2-activation-net.service \
> \"$sysreport_dir/systemd_lvm2_services_status\" 2>> \"$log\""
log "$SYSTEMCTL list-units -l -a --no-legend --no-pager > \"$sysreport_dir/systemd_unit_list\" 2>> \"$log\""
- for unit in $(cat $sysreport_dir/systemd_unit_list | $GREP lvm2-pvscan | cut -d " " -f 1); do
+ for unit in $(cat "$sysreport_dir/systemd_unit_list" | "$GREP" lvm2-pvscan | cut -d " " -f 1); do
log "$SYSTEMCTL status -l --no-pager -n $log_lines -o short-precise $unit >> \"$sysreport_dir/systemd_lvm2_pvscan_service_status\""
done
fi
@@ -316,12 +316,12 @@ fi
if (( $lvmetad )); then
(echo 'request="dump"'; echo '##') | {
- if type -p $SOCAT >& /dev/null; then
+ if type -p "$SOCAT" >& /dev/null; then
echo "$SOCAT unix-connect:$LVMETAD_SOCKET -" >> "$log"
- $SOCAT "unix-connect:$LVMETAD_SOCKET" - 2>> "$log"
- elif echo | $NC -U "$LVMETAD_SOCKET"; then
+ "$SOCAT" "unix-connect:$LVMETAD_SOCKET" - 2>> "$log"
+ elif echo | "$NC" -U "$LVMETAD_SOCKET"; then
echo "$NC -U $LVMETAD_SOCKET" >> "$log"
- $NC -U "$LVMETAD_SOCKET" 2>> "$log"
+ "$NC" -U "$LVMETAD_SOCKET" 2>> "$log"
else
myecho "WARNING: Neither socat nor nc -U seems to be available." 1>&2
echo "# DUMP FAILED"
@@ -332,12 +332,12 @@ fi
if (( $lvmpolld )); then
(echo 'request="dump"'; echo '##') | {
- if type -p $SOCAT >& /dev/null; then
+ if type -p "$SOCAT" >& /dev/null; then
echo "$SOCAT unix-connect:$LVMPOLLD_SOCKET -" >> "$log"
- $SOCAT "unix-connect:$LVMPOLLD_SOCKET" - 2>> "$log"
- elif echo | $NC -U "$LVMPOLLD_SOCKET"; then
+ "$SOCAT" "unix-connect:$LVMPOLLD_SOCKET" - 2>> "$log"
+ elif echo | "$NC" -U "$LVMPOLLD_SOCKET"; then
echo "$NC -U $LVMPOLLD_SOCKET" >> "$log"
- $NC -U "$LVMPOLLD_SOCKET" 2>> "$log"
+ "$NC" -U "$LVMPOLLD_SOCKET" 2>> "$log"
else
myecho "WARNING: Neither socat nor nc -U seems to be available." 1>&2
echo "# DUMP FAILED"
6 years, 9 months
master - lvmconf: prefer well defined and
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6330e2dc8621e0383a5...
Commit: 6330e2dc8621e0383a5606acbfb9687a34f1a668
Parent: ccdb75adcc737a6d5b510adbb69373016c27d827
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 19:25:41 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200
lvmconf: prefer well defined and
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
---
scripts/lvmconf.sh | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/scripts/lvmconf.sh b/scripts/lvmconf.sh
index e78a27e..cbeb4eb 100644
--- a/scripts/lvmconf.sh
+++ b/scripts/lvmconf.sh
@@ -150,7 +150,7 @@ function validate_args
exit 10
fi
- if [ "$HANDLE_CLUSTER" = "1" -a "$HANDLE_HALVM" = "1" ]; then
+ if [ "$HANDLE_CLUSTER" = 1 ] && [ "$HANDLE_HALVM" = 1 ]; then
echo "Either HA LVM or cluster method may be used at one time"
exit 18
fi
@@ -187,8 +187,10 @@ function validate_args
fi
- if [ "$LOCKING_TYPE" = "1" ] && [ -n "$LOCKINGLIBDIR" -o -n "$LOCKINGLIB" ]; then
- echo "Superfluous locking lib parameter, ignoring"
+ if [ "$LOCKING_TYPE" = 1 ] ; then
+ if [ -n "$LOCKINGLIBDIR" ] || [ -n "$LOCKINGLIB" ]; then
+ echo "Superfluous locking lib parameter, ignoring"
+ fi
fi
}
@@ -224,7 +226,7 @@ grep -q '^[[:blank:]]*use_lvmetad[[:blank:]]*=' $CONFIGFILE
have_use_lvmetad=$?
# Those options are in section "global {" so we must have one if any are present.
-if [ "$have_type" = "0" -o "$have_dir" = "0" -o "$have_library" = "0" -o "$have_use_lvmetad" = "0" ]
+if [ "$have_type" = 0 ] || [ "$have_dir" = 0 ] || [ "$have_library" = 0 ] || [ "$have_use_lvmetad" = 0 ]
then
# See if we can find it...
@@ -430,7 +432,7 @@ if [ "$HANDLE_SERVICES" == "1" ]; then
fi
# System V init scripts
- elif [ -n "$SERVICE_BIN" -a -n "$CHKCONFIG_BIN" ]; then
+ elif [ -n "$SERVICE_BIN" ] && [ -n "$CHKCONFIG_BIN" ]; then
if [ "$USE_LVMETAD" = "0" ]; then
set_service sysv deactivate lvm2-lvmetad
else
6 years, 9 months
master - lvmconf: double quote
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ccdb75adcc737a6d5b5...
Commit: ccdb75adcc737a6d5b510adbb69373016c27d827
Parent: de04e36fda20dbf1bcfb155e6b2faf584cde791d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 17:22:08 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200
lvmconf: double quote
---
scripts/lvmconf.sh | 44 ++++++++++++++++++++++----------------------
1 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/scripts/lvmconf.sh b/scripts/lvmconf.sh
index 3aab4a0..e78a27e 100644
--- a/scripts/lvmconf.sh
+++ b/scripts/lvmconf.sh
@@ -51,7 +51,7 @@ function usage
function set_default_use_lvmetad_var
{
- eval $(lvm dumpconfig --type default global/use_lvmetad 2>/dev/null)
+ eval "$(lvm dumpconfig --type default global/use_lvmetad 2>/dev/null)"
if [ "$?" != "0" ]; then
USE_LVMETAD=0
else
@@ -325,8 +325,8 @@ else
SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ use_lvmetad = $USE_LVMETAD"
fi
- echo -e $SEDCMD > $SCRIPTFILE
- sed <$CONFIGFILE >$TMPFILE -f $SCRIPTFILE
+ echo -e "$SEDCMD" > "$SCRIPTFILE"
+ sed <"$CONFIGFILE" >"$TMPFILE" -f "$SCRIPTFILE"
if [ $? != 0 ]
then
echo "sed failed, $CONFIGFILE not updated"
@@ -337,21 +337,21 @@ fi
# Now we have a suitably editted config file in a temp place,
# backup the original and copy our new one into place.
-cp $CONFIGFILE $CONFIGFILE.lvmconfold
+cp "$CONFIGFILE" "$CONFIGFILE.lvmconfold"
if [ $? != 0 ]
then
echo "failed to backup old config file, $CONFIGFILE not updated"
exit 2
fi
-cp $TMPFILE $CONFIGFILE
+cp "$TMPFILE" "$CONFIGFILE"
if [ $? != 0 ]
then
echo "failed to copy new config file into place, check $CONFIGFILE is still OK"
exit 3
fi
-rm -f $SCRIPTFILE $TMPFILE
+rm -f "$SCRIPTFILE" "$TMPFILE"
function set_service {
local type="$1"
@@ -360,42 +360,42 @@ function set_service {
if [ "$type" = "systemd" ]; then
if [ "$action" = "activate" ]; then
- for i in $@; do
+ for i in "$@"; do
unset LoadState
- eval $($SYSTEMCTL_BIN show $i -p LoadState 2>/dev/null)
+ eval "$($SYSTEMCTL_BIN show "$i" -p LoadState 2>/dev/null)"
test "$LoadState" = "loaded" || continue
- $SYSTEMCTL_BIN enable $i
+ $SYSTEMCTL_BIN enable "$i"
if [ "$START_STOP_SERVICES" = "1" ]; then
- $SYSTEMCTL_BIN start $i
+ $SYSTEMCTL_BIN start "$i"
fi
done
elif [ "$action" = "deactivate" ]; then
- for i in $@; do
+ for i in "$@"; do
unset LoadState
- eval $($SYSTEMCTL_BIN show $i -p LoadState 2>/dev/null)
+ eval "$($SYSTEMCTL_BIN show "$i" -p LoadState 2>/dev/null)"
test "$LoadState" = "loaded" || continue
- $SYSTEMCTL_BIN disable $i
+ $SYSTEMCTL_BIN disable "$i"
if [ "$START_STOP_SERVICES" = "1" ]; then
- $SYSTEMCTL_BIN stop $i
+ $SYSTEMCTL_BIN stop "$i"
fi
done
fi
elif [ "$type" = "sysv" ]; then
if [ "$action" = "activate" ]; then
- for i in $@; do
- $CHKCONFIG_BIN --list $i > /dev/null || continue
- $CHKCONFIG_BIN $i on
+ for i in "$@"; do
+ $CHKCONFIG_BIN --list "$i" > /dev/null || continue
+ $CHKCONFIG_BIN "$i" on
if [ "$START_STOP_SERVICES" = "1" ]; then
- $SERVICE_BIN $i start
+ $SERVICE_BIN "$i" start
fi
done
elif [ "$action" = "deactivate" ]; then
- for i in $@; do
- $CHKCONFIG_BIN --list $i > /dev/null || continue
+ for i in "$@"; do
+ $CHKCONFIG_BIN --list "$i" > /dev/null || continue
if [ "$START_STOP_SERVICES" = "1" ]; then
- $SERVICE_BIN $i stop
+ $SERVICE_BIN "$i" stop
fi
- $CHKCONFIG_BIN $i off
+ $CHKCONFIG_BIN "$i" off
done
fi
fi
6 years, 9 months
master - lvmconf: fix test for setting external locking type
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=de04e36fda20dbf1bcf...
Commit: de04e36fda20dbf1bcfb155e6b2faf584cde791d
Parent: daa372f78d316ded212ffd703a9740ff80632d38
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 17:22:22 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200
lvmconf: fix test for setting external locking type
Fix test for check of set locking lib dir.
---
scripts/lvmconf.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/lvmconf.sh b/scripts/lvmconf.sh
index caf7fae..3aab4a0 100644
--- a/scripts/lvmconf.sh
+++ b/scripts/lvmconf.sh
@@ -134,7 +134,7 @@ function parse_args
esac
done
- if [ "$LOCKINGLIBDIR" -o "$LOCKINGLIB" ]; then
+ if [ -n "$LOCKINGLIBDIR" ] || [ -n "$LOCKINGLIB" ]; then
LOCKING_TYPE=2
USE_LVMETAD=0
fi
6 years, 9 months
master - blkdeactivate: quote literal
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=daa372f78d316ded212...
Commit: daa372f78d316ded212ffd703a9740ff80632d38
Parent: b5fc0d73e551ed36c752e89b6f409935511f2ba4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 29 18:47:28 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200
blkdeactivate: quote literal
This { is literal. Check expression (missing ;/\n?) or quote it.
---
scripts/blkdeactivate.sh.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/blkdeactivate.sh.in b/scripts/blkdeactivate.sh.in
index a3528e5..969eace 100644
--- a/scripts/blkdeactivate.sh.in
+++ b/scripts/blkdeactivate.sh.in
@@ -242,7 +242,7 @@ deactivate_lvm () {
}
echo -n " [LVM]: deactivating Logical Volume $DM_VG_NAME/$DM_LV_NAME... "
- if eval "$LVM" lvchange $LVM_OPTS --config \'log{prefix=\"\"} $LVM_CONFIG\' -aln "$DM_VG_NAME/$DM_LV_NAME" "$OUT" "$ERR"; then
+ if eval "$LVM" lvchange $LVM_OPTS --config \'log\{prefix=\"\"\} $LVM_CONFIG\' -aln "$DM_VG_NAME/$DM_LV_NAME" "$OUT" "$ERR"; then
echo "done"
else
echo "skipping"
@@ -266,7 +266,7 @@ deactivate_lvm () {
done
echo -n " [LVM]: deactivating Volume Group $DM_VG_NAME... "
- if eval "$LVM" vgchange $LVM_OPTS --config \'log{prefix=\" \"} $LVM_CONFIG\' -aln "$DM_VG_NAME" "$OUT" "$ERR"; then
+ if eval "$LVM" vgchange $LVM_OPTS --config \'log\{prefix=\" \"\} $LVM_CONFIG\' -aln "$DM_VG_NAME" "$OUT" "$ERR"; then
echo "done"
else
echo "skipping"
6 years, 9 months