Skip to content

Commit 7c791f3

Browse files
authored
Merge pull request #1015 from 0xJacky/dev
chore: update install.sh
2 parents 1570771 + a2e1c57 commit 7c791f3

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

internal/cache/index.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func (s *Scanner) scanSingleFile(filePath string) error {
348348
if strings.Contains(includePath, "*") {
349349
// If it's a relative path, make it absolute based on nginx config dir
350350
if !filepath.IsAbs(includePath) {
351-
configDir := filepath.Dir(nginx.GetConfPath("", ""))
351+
configDir := filepath.Dir(nginx.GetConfPath())
352352
includePath = filepath.Join(configDir, includePath)
353353
}
354354

@@ -373,7 +373,7 @@ func (s *Scanner) scanSingleFile(filePath string) error {
373373
// Handle single file include
374374
// If it's a relative path, make it absolute based on nginx config dir
375375
if !filepath.IsAbs(includePath) {
376-
configDir := filepath.Dir(nginx.GetConfPath("", ""))
376+
configDir := filepath.Dir(nginx.GetConfPath())
377377
includePath = filepath.Join(configDir, includePath)
378378
}
379379

@@ -413,7 +413,7 @@ func (s *Scanner) ScanAllConfigs() error {
413413
}()
414414

415415
// Get the main config file
416-
mainConfigPath := nginx.GetConfPath("", "nginx.conf")
416+
mainConfigPath := nginx.GetConfEntryPath()
417417
err := s.scanSingleFile(mainConfigPath)
418418
if err != nil {
419419
logger.Error("Failed to scan main config:", err)

internal/performance/config_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func GetNginxWorkerConfigInfo() (*NginxConfigInfo, error) {
5151
},
5252
}
5353

54-
confPath := nginx.GetConfPath("nginx.conf")
54+
confPath := nginx.GetConfEntryPath()
5555
if confPath == "" {
5656
return nil, errors.New("failed to get nginx.conf path")
5757
}

internal/performance/perf_opt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type PerfOpt struct {
5353

5454
// UpdatePerfOpt updates the Nginx performance optimization settings
5555
func UpdatePerfOpt(opt *PerfOpt) error {
56-
confPath := nginx.GetConfPath("nginx.conf")
56+
confPath := nginx.GetConfEntryPath()
5757
if confPath == "" {
5858
return errors.New("failed to get nginx.conf path")
5959
}

resources/services/nginx-ui.init

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ CONFIG="/usr/local/etc/nginx-ui/app.ini"
1717

1818
start() {
1919
echo "Starting $NAME..."
20-
start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --exec $DAEMON -- $CONFIG
20+
# BusyBox compatible syntax
21+
start-stop-daemon -S -b -p $PIDFILE -m -x $DAEMON -- $CONFIG
2122
echo "$NAME started"
2223
}
2324

2425
stop() {
2526
echo "Stopping $NAME..."
26-
start-stop-daemon --stop --pidfile $PIDFILE --retry 10
27+
# BusyBox compatible syntax
28+
start-stop-daemon -K -p $PIDFILE -R 10
2729
rm -f $PIDFILE
2830
echo "$NAME stopped"
2931
}

0 commit comments

Comments
 (0)