Browse Source

transmission: fix directory creation in init script

Things were done in the wrong order, leading to config_dir not being
chown'ed and subdirectories not being created in case of download_dir
being inside config_dir.

Fixes: 609109fa9 ("transmission: add seccomp filter and improve jail")
Reported-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
lilik-openwrt-22.03
Daniel Golle 5 years ago
parent
commit
2cce710984
1 changed files with 12 additions and 12 deletions
  1. +12
    -12
      net/transmission/files/transmission.init

+ 12
- 12
net/transmission/files/transmission.init View File

@ -73,18 +73,6 @@ transmission() {
USE=$((MEM * mem_percentage * 10)) USE=$((MEM * mem_percentage * 10))
fi fi
[ -d "$download_dir" ] || {
mkdir -p "$download_dir"
chmod 0755 "$download_dir"
[ -z "$user" ] || chown -R "$user:$group" "$download_dir"
}
[ "$incomplete_dir_enabled" = "0" ] || [ -d "$incomplete_dir" ] || {
mkdir -p "$incomplete_dir"
chmod 0755 "$incomplete_dir"
[ -z "$user" ] || chown -R "$user:$group" "$incomplete_dir"
}
config_file="$config_dir/settings.json" config_file="$config_dir/settings.json"
[ -d "$config_dir" ] || { [ -d "$config_dir" ] || {
mkdir -p "$config_dir" mkdir -p "$config_dir"
@ -97,6 +85,18 @@ transmission() {
[ -z "$user" ] || chown -R "$user:$group" "$config_dir" [ -z "$user" ] || chown -R "$user:$group" "$config_dir"
} }
[ -d "$download_dir" ] || {
mkdir -p "$download_dir"
chmod 0755 "$download_dir"
[ -z "$user" ] || chown -R "$user:$group" "$download_dir"
}
[ "$incomplete_dir_enabled" = "0" ] || [ -d "$incomplete_dir" ] || {
mkdir -p "$incomplete_dir"
chmod 0755 "$incomplete_dir"
[ -z "$user" ] || chown -R "$user:$group" "$incomplete_dir"
}
[ "$config_overwrite" = 0 ] || { [ "$config_overwrite" = 0 ] || {
echo "{" > "$config_file" echo "{" > "$config_file"


Loading…
Cancel
Save