fix: always show install-service option regardless of current state
This commit is contained in:
+3
-5
@@ -801,11 +801,9 @@ function Main-Menu {
|
|||||||
$hasService = $hubExists -or $runnerExists
|
$hasService = $hubExists -or $runnerExists
|
||||||
$autostartEnabled = ($hubExists -and "$($script:STATUS_AUTOSTART_HUB)" -ne "Disabled") -or ($runnerExists -and "$($script:STATUS_AUTOSTART_RUNNER)" -ne "Disabled")
|
$autostartEnabled = ($hubExists -and "$($script:STATUS_AUTOSTART_HUB)" -ne "Disabled") -or ($runnerExists -and "$($script:STATUS_AUTOSTART_RUNNER)" -ne "Disabled")
|
||||||
|
|
||||||
if (-not $hasService) {
|
Write-Host " $i) 安装计划任务 (hub + runner)"
|
||||||
Write-Host " $i) 安装计划任务 (hub + runner)"
|
$options += "setup_autostart"
|
||||||
$options += "setup_autostart"
|
$i++
|
||||||
$i++
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($autostartEnabled) {
|
if ($autostartEnabled) {
|
||||||
Write-Host " $i) 禁用开机自启"
|
Write-Host " $i) 禁用开机自启"
|
||||||
|
|||||||
+3
-5
@@ -1168,11 +1168,9 @@ main_menu() {
|
|||||||
local autostart_enabled=false
|
local autostart_enabled=false
|
||||||
[[ "$STATUS_AUTOSTART_HUB_ENABLED" == "enabled" || "$STATUS_AUTOSTART_RUNNER_ENABLED" == "enabled" ]] && autostart_enabled=true
|
[[ "$STATUS_AUTOSTART_HUB_ENABLED" == "enabled" || "$STATUS_AUTOSTART_RUNNER_ENABLED" == "enabled" ]] && autostart_enabled=true
|
||||||
|
|
||||||
if [[ "$has_service" == false ]]; then
|
echo " $i) 安装系统服务 (hub + runner)"
|
||||||
echo " $i) 安装系统服务 (hub + runner)"
|
options+=("setup_autostart")
|
||||||
options+=("setup_autostart")
|
((i++))
|
||||||
((i++))
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$autostart_enabled" == true ]]; then
|
if [[ "$autostart_enabled" == true ]]; then
|
||||||
echo " $i) 禁用开机自启"
|
echo " $i) 禁用开机自启"
|
||||||
|
|||||||
Reference in New Issue
Block a user