mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 05:29:30 +00:00
Die if --log, --pid, or --dest aren't accessible. Also die if po dir isn't accessible.
This commit is contained in:
@@ -57,6 +57,9 @@ make_pid_file() {
|
||||
|
||||
# PID file doesn't exist, or it does but its pid is stale.
|
||||
echo "$pid" > "$file"
|
||||
if [ $? -ne 0 ]; then
|
||||
die "Cannot create or write PID file $file"
|
||||
fi
|
||||
}
|
||||
|
||||
remove_pid_file() {
|
||||
|
@@ -111,8 +111,20 @@ parse_options() {
|
||||
# default=foo
|
||||
# That's the spec for --string-opt2. Each line is a key:value pair
|
||||
# from the option's POD line like "type: string; default: foo".
|
||||
mkdir "$TMPDIR/po/" 2>/dev/null
|
||||
if [ ! -d "$TMPDIR/po/" ]; then
|
||||
mkdir "$TMPDIR/po/"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cannot mkdir $TMPDIR/po/" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf "$TMPDIR"/po/*
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cannot rm -rf $TMPDIR/po/*" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
(
|
||||
export PO_DIR="$TMPDIR/po"
|
||||
cat "$file" | perl -ne '
|
||||
|
Reference in New Issue
Block a user