|
@@ -61,16 +61,18 @@ wait_for_deaddaemon () {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-if test ! -d $TORPIDDIR; then
|
|
|
|
- echo "There is no $TORPIDDIR directory. Creating one for you."
|
|
|
|
- mkdir -m 02700 "$TORPIDDIR"
|
|
|
|
- chown debian-tor:debian-tor "$TORPIDDIR"
|
|
|
|
-fi
|
|
|
|
|
|
+check_torpiddir () {
|
|
|
|
+ if test ! -d $TORPIDDIR; then
|
|
|
|
+ echo "There is no $TORPIDDIR directory. Creating one for you."
|
|
|
|
+ mkdir -m 02700 "$TORPIDDIR"
|
|
|
|
+ chown debian-tor:debian-tor "$TORPIDDIR"
|
|
|
|
+ fi
|
|
|
|
|
|
-if test ! -x $TORPIDDIR; then
|
|
|
|
- echo "Cannot access $TORPIDDIR directory, are you root?" >&2
|
|
|
|
- exit 1
|
|
|
|
-fi
|
|
|
|
|
|
+ if test ! -x $TORPIDDIR; then
|
|
|
|
+ echo "Cannot access $TORPIDDIR directory, are you root?" >&2
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
case "$1" in
|
|
@@ -89,6 +91,8 @@ case "$1" in
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+ check_torpiddir
|
|
|
|
+
|
|
echo "Starting $DESC: $NAME..."
|
|
echo "Starting $DESC: $NAME..."
|
|
if ! su -s /bin/sh -c "$DAEMON --verify-config" debian-tor > /dev/null; then
|
|
if ! su -s /bin/sh -c "$DAEMON --verify-config" debian-tor > /dev/null; then
|
|
echo "ABORTED: Tor configuration invalid:" >&2
|
|
echo "ABORTED: Tor configuration invalid:" >&2
|