Permalink
Browse files

Properly quote the variables or the check will be a false positive

  • Loading branch information...
1 parent 3b2fea6 commit 562fc0ef834df16e87a04c0e3d3133ad067ae8de @Ratler committed Aug 6, 2012
Showing with 10 additions and 10 deletions.
  1. +7 −7 lnet/lnet
  2. +2 −2 lservices/lservices
  3. +1 −1 ltime/ltime
View
@@ -239,7 +239,7 @@ function gateway_config() {
GATEWAY=$(cat /etc/config.d/gateway)
GATEWAY=`inputbox "$GATEWAY_PROMPT" "$GATEWAY"`
echo "$GATEWAY" > /etc/config.d/gateway
- if [ -n $SYSTEMDUNITDIR ]; then
+ if [ -n "$SYSTEMDUNITDIR" ]; then
if [ -n "$GATEWAY" ]; then
systemd_gw_template
systemctl daemon-reload &> /dev/null
@@ -352,7 +352,7 @@ function ethernet_manage_device() {
case $COMMAND in
S)
# Assume systemd is running
- if [ -n $SYSTEMDUNITDIR ]; then
+ if [ -n "$SYSTEMDUNITDIR" ]; then
SERVICETYPE=$(get_systemd_servicetype)
systemctl ${TOGGLE/S/s} ${SERVICETYPE}@${1}.service
else
@@ -361,7 +361,7 @@ function ethernet_manage_device() {
;;
R)
# Assume systemd is running
- if [ -n $SYSTEMDUNITDIR ]; then
+ if [ -n "$SYSTEMDUNITDIR" ]; then
SERVICETYPE=$(get_systemd_servicetype)
systemctl restart ${SERVICETYPE}@${1}.service
else
@@ -453,7 +453,7 @@ while true ; do
--default-item "$DEFAULT" \
--menu "" 0 0 0 \
"A" "Automatically start? [${AUTO:-Y}]" \
- $(if [ -z $SYSTEMDUNITDIR ]; then
+ $(if [ -z "$SYSTEMDUNITDIR" ]; then
echo "L"
echo "kernel module to Load [${MODULE:-}]"
echo "Z"
@@ -488,7 +488,7 @@ while true ; do
echo "Netmask [${NETMASK}]"
echo "B"
echo "Broadcast [${BROADCAST}]"
- if [ -z $SYSTEMDUNITDIR ]; then
+ if [ -z "$SYSTEMDUNITDIR" ]; then
echo "F"
echo "Ifconfig options [${IFCONF_OPTS:-}]"
fi
@@ -498,7 +498,7 @@ while true ; do
if [ $? != 0 ]; then
# Assume systemd is running if SYSTEMDUNITDIR variable is set
- if [ -n $SYSTEMDUNITDIR ]; then
+ if [ -n "$SYSTEMDUNITDIR" ]; then
DHCP_TIMEOUT="This device uses DHCP. If no DHCP servers are available to give an IP address\nyou may need to wait for the device to timeout."
[ "$ADDRESS" = "dhcp" ] && $DIALOG --infobox "$DHCP_TIMEOUT" 0 0
[ "$AUTO" = "Y" ] && systemd_enable $DEVICE $(get_systemd_servicetype) || systemd_disable_existing $DEVICE
@@ -587,7 +587,7 @@ done
}
. /etc/lunar/config
-. $BOOTSTRAP
+[ -n "$BOOTSTRAP" ] && . $BOOTSTRAP
root_check
View
@@ -197,7 +197,7 @@ main_menu() {
--menu \
"( Legend: +=enabled, -=disabled, 1=started, 0=stopped)" \
0 0 0 \
- $(if [ -n $SYSTEMDUNITDIR ]; then
+ $(if [ -n "$SYSTEMDUNITDIR" ]; then
list_systemd_services
else
list_initd_services
@@ -214,7 +214,7 @@ main_menu() {
}
. /etc/lunar/config
-[ -n $BOOTSTRAP ] && . $BOOTSTRAP
+[ -n "$BOOTSTRAP" ] && . $BOOTSTRAP
export IFS="$TAB_ENTER_IFS"
export LC_ALL=C
View
@@ -77,7 +77,7 @@ timezone_menu()
}
. /etc/lunar/config
-[ -n $BOOTSTRAP ] && . $BOOTSTRAP
+[ -n "$BOOTSTRAP" ] && . $BOOTSTRAP
export IFS="$TAB_ENTER_IFS"

0 comments on commit 562fc0e

Please sign in to comment.