Sanitation

Whitespace fixes etc
This commit is contained in:
Patrick Van der Veken 2015-08-18 07:46:23 +02:00
parent c927fe8f1f
commit ba260576b5
4 changed files with 50 additions and 50 deletions

View File

@ -73,20 +73,20 @@ if ($options{'help'}) {
# check file parameter # check file parameter
if ($options{'file'}) { if ($options{'file'}) {
$key_file = $options{'file'}; $key_file = $options{'file'};
unless (-f $key_file) { unless (-f $key_file) {
die "ERROR: input file $key_file not found [$!]"; die "ERROR: input file $key_file not found [$!]";
} }
} else { } else {
die "ERROR: missing value for --file parameter"; die "ERROR: missing value for --file parameter";
} }
# check label parameter # check label parameter
if ($options{'label'}) { if ($options{'label'}) {
$key_label = $options{'label'}; $key_label = $options{'label'};
if (not (defined ($key_label) or $key_label eq "")) { if (not (defined ($key_label) or $key_label eq "")) {
die "ERROR: key label not defined"; die "ERROR: key label not defined";
} }
} else { } else {
die "ERROR: missing value for --label parameter"; die "ERROR: missing value for --label parameter";
} }
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -99,32 +99,32 @@ close (KEY_FILE);
# determine type of key # determine type of key
if (grep { /$key_algo/ } @key_file) { if (grep { /$key_algo/ } @key_file) {
$key_type = 1; $key_type = 1;
} else { } else {
$key_type = 2; $key_type = 2;
} }
# process key # process key
SWITCH: { SWITCH: {
$key_type == 1 && do { $key_type == 1 && do {
# 1 line only!! # 1 line only!!
foreach (@key_file) { foreach (@key_file) {
chomp; chomp;
($key_algo, $key_line) = split (/ /); ($key_algo, $key_line) = split (/ /);
}; };
last SWITCH; last SWITCH;
}; };
$key_type == 2 && do { $key_type == 2 && do {
foreach (@key_file) { foreach (@key_file) {
chomp; chomp;
# skip BEGIN/END lines # skip BEGIN/END lines
next if (/^----/); next if (/^----/);
# skip Comment field # skip Comment field
next if (/^Comment/); next if (/^Comment/);
$key_line .= $_; $key_line .= $_;
} }
last SWITCH; last SWITCH;
}; };
} }
# mangle space in label # mangle space in label

View File

@ -810,7 +810,7 @@ do
log "child process ${PID} exited [OK]" log "child process ${PID} exited [OK]"
fi fi
done done
# break loop if we no child PIDs left # break loop if we have no child PIDs left
(($# > 0)) || break (($# > 0)) || break
sleep 1 # required to avoid race conditions sleep 1 # required to avoid race conditions
done done
@ -941,16 +941,16 @@ done
# check for configuration files (local overrides local) # check for configuration files (local overrides local)
if [[ -r "${SCRIPT_DIR}/${GLOBAL_CONFIG_FILE}" || -r "${SCRIPT_DIR}/${LOCAL_CONFIG_FILE}" ]] if [[ -r "${SCRIPT_DIR}/${GLOBAL_CONFIG_FILE}" || -r "${SCRIPT_DIR}/${LOCAL_CONFIG_FILE}" ]]
then then
if [[ -r "${SCRIPT_DIR}/${GLOBAL_CONFIG_FILE}" ]] if [[ -r "${SCRIPT_DIR}/${GLOBAL_CONFIG_FILE}" ]]
then then
. "${SCRIPT_DIR}/${GLOBAL_CONFIG_FILE}" . "${SCRIPT_DIR}/${GLOBAL_CONFIG_FILE}"
fi fi
if [[ -r "${SCRIPT_DIR}/${LOCAL_CONFIG_FILE}" ]] if [[ -r "${SCRIPT_DIR}/${LOCAL_CONFIG_FILE}" ]]
then then
. "${SCRIPT_DIR}/${LOCAL_CONFIG_FILE}" . "${SCRIPT_DIR}/${LOCAL_CONFIG_FILE}"
fi fi
else else
print -u2 "ERROR: could not find global or local configuration file" print -u2 "ERROR: could not find global or local configuration file"
fi fi
# startup checks # startup checks

View File

@ -545,7 +545,7 @@ unless ($preview) {
last SWITCH_RELEASE; last SWITCH_RELEASE;
}; };
} }
} }
# use fall back in case we cannot determine the version # use fall back in case we cannot determine the version
if (not (defined ($linux_version)) or $linux_version eq "") { if (not (defined ($linux_version)) or $linux_version eq "") {
$selinux_context = 'etc_t'; $selinux_context = 'etc_t';
@ -554,10 +554,10 @@ unless ($preview) {
$selinux_context = $selinux_contexts{$linux_version}; $selinux_context = $selinux_contexts{$linux_version};
} }
if ($has_selinux) { if ($has_selinux) {
do_log ("INFO: runtime info: OS major version $linux_version, SELinux context $selinux_context on $hostname"); do_log ("INFO: runtime info: OS major version $linux_version, SELinux context $selinux_context on $hostname");
} else { } else {
do_log ("INFO: runtime info: OS major version $linux_version on $hostname"); do_log ("INFO: runtime info: OS major version $linux_version on $hostname");
} }
last SWITCH_OS; last SWITCH_OS;
}; };
} }