Skip to content

Commit

Permalink
chore(init): optimize create ruleset dir
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <[email protected]>
  • Loading branch information
1715173329 committed Jan 22, 2024
1 parent 9102f42 commit faa1526
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion root/etc/homeproxy/scripts/generate_client.uc
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ if (!isEmpty(main_node)) {
config.route.final = get_outbound(default_outbound);
};

/* Ruleset */
/* Rule set */
if (routing_mode === 'custom') {
uci.foreach(uciconfig, uciruleset, (cfg) => {
if (cfg.enabled !== '1')
Expand Down
6 changes: 5 additions & 1 deletion root/etc/init.d/homeproxy
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ start_service() {
no-resolv
server=127.0.0.1#$dns_port
EOF
[ -d "$HP_DIR/ruleset" ] || mkdir -p "$HP_DIR/ruleset"
;;
esac

Expand Down Expand Up @@ -259,6 +258,11 @@ start_service() {
procd_set_param respawn
procd_close_instance

# Prepare ruleset directory for custom routing mode
if [ "$routing_mode" = "custom" ]; then
[ -d "$HP_DIR/ruleset" ] || mkdir -p "$HP_DIR/ruleset"
fi

# Update permissions for ujail
if [ "$outbound_node" != "nil" ]; then
echo > "$RUN_DIR/sing-box-c.log"
Expand Down

0 comments on commit faa1526

Please sign in to comment.