Skip to content

Commit 04835d1

Browse files
committed
chore(sing-box): simplify script
1 parent a0afacd commit 04835d1

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

network/sing-box/sing-box.spec

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,27 +95,12 @@ CGO_ENABLED=0 go build \
9595
-s -w -buildid=" \
9696
./cmd/sing-box
9797

98-
sed -i "/^\[Service\]$/a StateDirectory=%{name}" release/config/%{name}.service
99-
sed -i "/^\[Service\]$/a StateDirectory=%{name}-%i" release/config/%{name}@.service
100-
sed -i "/^\[Service\]$/a User=%{name}" release/config/%{name}*.service
101-
102-
echo "u %{name} - \"Sing-box Service\" - -" > "release/config/%{name}.sysusers"
10398

10499
install -d completions
105100
./sing-box completion bash > completions/bash
106101
./sing-box completion fish > completions/fish
107102
./sing-box completion zsh > completions/zsh
108103

109-
echo -n \
110-
'// Allow sing-box to set domain and default-route
111-
polkit.addRule(function(action, subject) {
112-
if ((action.id == "org.freedesktop.resolve1.set-domains" ||
113-
action.id == "org.freedesktop.resolve1.set-default-route" ||
114-
action.id == "org.freedesktop.resolve1.set-dns-servers") &&
115-
subject.user == "sing-box") {
116-
return polkit.Result.YES;
117-
}
118-
});' > release/config/%{name}.rules
119104

120105
%install
121106
install -Dsm755 %{name} -t %{buildroot}%{_bindir}

0 commit comments

Comments
 (0)