@@ -30,9 +30,9 @@ def parseArgs():
3030 'https://www.iso.org/obp/ui/#search' )
3131
3232 if os .getuid () != 0 :
33- print ("This script must be run as sudo.\n " )
33+ print ("This script must be run as sudo.\n " , file = sys . stderr )
3434 parser .print_help ()
35- exit (1 )
35+ sys . exit (1 )
3636
3737 args = parser .parse_args ()
3838 args .device_path = args .device_path .rstrip ('/' )
@@ -54,7 +54,7 @@ def imageSdCard():
5454 break
5555 time .sleep (0.5 )
5656 if time .time () > time_limit :
57- print (f"Failed to remount { args .device_path } ." )
57+ print (f"Failed to remount { args .device_path } ." , file = sys . stderr )
5858 sys .exit (1 )
5959
6060 # prevent weirdness where subsequent writes are flakey?
@@ -76,20 +76,20 @@ def validate():
7676 try :
7777 command (f'sudo ls -l { args .device_path } /cmdline.txt' )
7878 except Exception :
79- print ("ERROR: failed to validate raspbian install" )
80- exit (1 )
79+ print ("ERROR: failed to validate raspbian install" , file = sys . stderr )
80+ sys . exit (1 )
8181
8282 try :
8383 command (f'sudo ls -l { args .device_path } /ssh' )
8484 except Exception :
85- print ("ERROR: failed to validate ssh setup" )
86- exit (1 )
85+ print ("ERROR: failed to validate ssh setup" , file = sys . stderr )
86+ sys . exit (1 )
8787
8888 try :
8989 command (f'sudo ls -l { args .device_path } /wpa_supplicant.conf' )
9090 except Exception :
91- print ("ERROR: failed to validate wifi setup" )
92- exit (1 )
91+ print ("ERROR: failed to validate wifi setup" , file = sys . stderr )
92+ sys . exit (1 )
9393
9494def finish ():
9595 print ("Ejecting SD card..." )
0 commit comments