File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ Argument options will be applied before the config fil
5555
5656-nokeymap Don't config the keymap for the new system
5757
58+ -noreboot Don't reboot the system after the prosess
5859`
5960
6061func PrintHelp () {
@@ -85,6 +86,7 @@ func main() {
8586 src .Keymap ()
8687 src .ConfigRootPasswd ()
8788 src .FinalCmds ()
89+ src .Reboot ()
8890 case "pacstrap" :
8991 src .Wifi ()
9092 src .PacmanConf ()
Original file line number Diff line number Diff line change 66 "os"
77 "os/exec"
88 "strings"
9+ "time"
910
1011 "github.com/Tom5521/ArchLinuxInstaller/data"
1112 "github.com/Tom5521/CmdRunTools/command"
@@ -262,7 +263,7 @@ func Wifi() {
262263 fmGreen ("Connected to " + wifi .Name )
263264 }
264265 } else {
265- Error ( "Warning: Adaptator not found" )
266+ Warn ( " Adaptator not found" )
266267 }
267268 wifi_pkg = "networkmanger iwd"
268269 }
@@ -389,10 +390,25 @@ func FinalCmds() {
389390 Error ("Error using arch-chroot." )
390391 }
391392 }
392- if conf .Reboot {
393+
394+ }
395+
396+ func Reboot () {
397+ if strings .Contains (args , "-noreboot" ) {
398+ return
399+ }
400+ var err error
401+ if ! conf .Reboot {
393402 err = sh .SetAndRun ("reboot" )
394403 if err != nil {
395404 Error ("Error in... in... Reboot? wtf" )
405+ for i := 5 ; i != 0 ; i -- {
406+ time .Sleep (1 * time .Second )
407+ fmt .Print (f ("\r Retrying in...%v seconds" , i ))
408+ if i == 1 {
409+ Reboot ()
410+ }
411+ }
396412 }
397413 }
398414}
You can’t perform that action at this time.
0 commit comments