Skip to content

Commit

Permalink
fix(init): fix permission for cache.db
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <[email protected]>
  • Loading branch information
1715173329 committed Jan 6, 2025
1 parent 4afced1 commit 51e49d9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions root/etc/init.d/homeproxy
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ start_service() {
procd_add_jail "sing-box-c" log procfs
procd_add_jail_mount "$RUN_DIR/sing-box-c.json"
procd_add_jail_mount_rw "$RUN_DIR/sing-box-c.log"
procd_add_jail_mount_rw "$RUN_DIR/cache.db"
[ "$routing_mode" != "bypass_mainland_china" ] || procd_add_jail_mount_rw "$RUN_DIR/cache.db"
procd_add_jail_mount "$HP_DIR/certs/"
procd_add_jail_mount "/etc/ssl/"
procd_add_jail_mount "/etc/localtime"
Expand Down Expand Up @@ -216,10 +216,16 @@ start_service() {
procd_set_param respawn
procd_close_instance

# Prepare ruleset directory for custom routing mode
if [ "$routing_mode" = "custom" ]; then
case "$rouing_mode" in
"bypass_mainland_china")
# Prepare cache db
[ -e "$RUN_DIR/cache.db" ] || touch "$RUN_DIR/cache.db"
;;
"custom")
# Prepare ruleset directory
[ -d "$HP_DIR/ruleset" ] || mkdir -p "$HP_DIR/ruleset"
fi
;;
esac

# Update permissions for ujail
if [ "$outbound_node" != "nil" ]; then
Expand Down

0 comments on commit 51e49d9

Please sign in to comment.