(BraceGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:INPUT) op:Equal rhs:{(-1)} spids:[71])] spids: [71] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_EqualTilde left: {($ VSub_Number '$1')} right: {(Lit_Other '^') (-) (Lit_Other '?') (Lit_Other '[') (0-9) (Lit_Other ']') (Lit_Other '+') (Lit_Other '$') } ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:INPUT) op: Equal rhs: {($ VSub_Number '$1')} spids: [99] ) ] spids: [99] ) ] spids: [16777215 95] ) ] spids: [16777215 104] ) (C {(.)} {(/DietPi/dietpi/func/dietpi-globals)}) (C {(G_CHECK_ROOT_USER)}) (C {(export)} {(Lit_VarLike 'G_PROGRAM_NAME=') (SQ <DietPi-Autostart>)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:WHIP_BACKTITLE) op: Equal rhs: {(SQ <DietPi-AutoStart>)} spids: [145] ) ] spids: [145] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:WHIP_TITLE) op: Equal rhs: {($ VSub_Name '$WHIP_BACKTITLE')} spids: [151] ) ] spids: [151] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:CHOICE) op:Equal rhs:{(0)} spids:[155])] spids: [155] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:OPTION) op:Equal rhs:{(0)} spids:[159])] spids: [159] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:TARGETMENUID) op:Equal rhs:{(0)} spids:[163])] spids: [163] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:AUTO_START_INDEX) op:Equal rhs:{(0)} spids:[168])] spids: [168] ) (FuncDef name: Apply_Boot_Index body: (BraceGroup children: [ (SimpleCommand words: [{(systemctl)} {(disable)} {(lightdm.service)}] redirects: [(Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})] ) (SimpleCommand words: [{(systemctl)} {(disable)} {(amiberry.service)}] redirects: [(Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})] ) (SimpleCommand words: [{(systemctl)} {(disable)} {(amiberry-sdl2.service)}] redirects: [(Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})] ) (C {(sed)} {(-i)} {(SQ <'/^boot_delay=0/d'>)} {(/DietPi/config.txt)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-f)} {(/boot/cmdline.txt)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (C {(sed)} {(-i)} {(SQ <s/logo.nologo//>)} {(/boot/cmdline.txt)}) (C {(sed)} {(-i)} {(SQ <'s/loglevel=3//'>)} {(/boot/cmdline.txt)}) (C {(sed)} {(-i)} {(SQ <'s/console=tty3/console=tty1/'>)} {(/boot/cmdline.txt)}) ] spids: [16777215 246] ) ] spids: [16777215 284] ) (SimpleCommand words: [{(rm)} {(/etc/systemd/system/dietpi-autostart_custom.service)}] redirects: [(Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})] ) (SimpleCommand words: [ {(rm)} {(/etc/systemd/system/getty) (Lit_Other '@') (tty1.service.d/autologin.conf)} ] redirects: [(Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$AUTO_START_INDEX')}) right: (ArithWord w:{(Lit_Digits 14)}) ) spids: [332 341] ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(_EOF_)} here_end_span_id: 373 stdin_parts: [ ('[Unit]\n') ( 'Description=DietPi autostart (Custom /var/lib/dietpi/dietpi-autostart/custom.sh)\n' ) ( 'After=dietpi-boot.service dietpi-ramdisk.service dietpi-ramlog.service rc-local.service\n' ) ('Requires=dietpi-boot.service dietpi-ramdisk.service\n') ('\n') ('[Service]\n') ('Type=idle\n') ( "ExecStartPre=/bin/bash echo -e 'Starting DietPi-Autostart (Custom) script'\n" ) ('ExecStart=/bin/bash -c /var/lib/dietpi/dietpi-autostart/custom.sh\n') ('StandardOutput=tty\n') ('RemainAfterExit=yes\n') ('\n') ('[Install]\n') ('WantedBy=multi-user.target\n') ] ) (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/etc/systemd/system/dietpi-autostart_custom.service)} ) ] ) (C {(systemctl)} {(enable)} {(dietpi-autostart_custom.service)}) ] spids: [16777215 344] ) (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DPipe left: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$AUTO_START_INDEX')}) right: (ArithWord w:{(Lit_Digits 6)}) ) right: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$AUTO_START_INDEX')}) right: (ArithWord w:{(Lit_Digits 12)}) ) ) spids: [389 406] ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$AUTO_START_INDEX')}) right: (ArithWord w:{(Lit_Digits 6)}) ) spids: [419 428] ) terminator: <Op_Semi ';'> ) ] action: [(C {(systemctl)} {(enable)} {(amiberry.service)})] spids: [16777215 431] ) ] else_action: [(C {(systemctl)} {(enable)} {(amiberry-sdl2.service)})] spids: [447 459] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithUnary op_id: Arith_Bang child: (ArithWord w: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/DietPi/config.txt)}) (C {(grep)} {(-ci)} {(-m1)} {(SQ <'^boot_delay=0'>)} ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [473 489] ) } ) ) spids: [469 492] ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(echo)} {(-e)} {(DQ ('boot_delay=0') (Lit_Other '\\') (n))}] redirects: [ (Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(/DietPi/config.txt)} ) ] ) ] spids: [16777215 495] ) ] spids: [16777215 515] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithUnary op_id: Arith_Bang child: (ArithWord w: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/boot/cmdline.txt)}) (C {(grep)} {(-ci)} {(-m1)} {(SQ <' logo.nologo'>)} ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [525 541] ) } ) ) spids: [521 544] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(sed)} {(-i)} {(SQ <'s/rootwait/rootwait logo.nologo/'>)} {(/boot/cmdline.txt)} ) ] spids: [16777215 547] ) ] spids: [16777215 563] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithUnary op_id: Arith_Bang child: (ArithWord w: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/boot/cmdline.txt)}) (C {(grep)} {(-ci)} {(-m1)} {(SQ <' loglevel=3'>)} ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [573 589] ) } ) ) spids: [569 592] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(sed)} {(-i)} {(SQ <'s/rootwait/rootwait loglevel=3/'>)} {(/boot/cmdline.txt)} ) ] spids: [16777215 595] ) ] spids: [16777215 611] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithUnary op_id: Arith_Bang child: (ArithWord w: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/boot/cmdline.txt)}) (C {(grep)} {(-ci)} {(-m1)} {(SQ <' console=tty3'>)} ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [621 637] ) } ) ) spids: [617 640] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(sed)} {(-i)} {(SQ <'s/console=tty1/console=tty3/'>)} {(/boot/cmdline.txt)} ) ] spids: [16777215 643] ) ] spids: [16777215 659] ) ] spids: [387 409] ) (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithWord w:{($ VSub_Name '$AUTO_START_INDEX')}) right: (ArithWord w:{(Lit_Digits 0)}) ) spids: [669 678] ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(mkdir)} {(-p)} {(/etc/systemd/system/getty) (Lit_Other '@') (tty1.service.d)} ] redirects: [(Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})] ) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(_EOF_)} here_end_span_id: 716 stdin_parts: [ ('[Service]\n') ('ExecStart=\n') ('ExecStart=-/sbin/agetty --autologin root %I ') ($ VSub_Name '$TERM') ('\n') ] ) (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/etc/systemd/system/getty) (Lit_Other '@') (tty1.service.d/autologin.conf) } ) ] ) ] spids: [667 681] ) ] spids: [16777215 719] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Less left: (ArithWord w:{($ VSub_Name '$G_HW_MODEL')}) right: (ArithWord w:{(Lit_Digits 10)}) ) spids: [729 738] ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DPipe left: (ArithBinary op_id: Arith_DPipe left: (ArithBinary op_id: Arith_DPipe left: (ArithBinary op_id: Arith_DEqual left: (ArithWord w: {($ VSub_Name '$AUTO_START_INDEX')} ) right: (ArithWord w:{(Lit_Digits 6)}) ) right: (ArithBinary op_id: Arith_DEqual left: (ArithWord w: {($ VSub_Name '$AUTO_START_INDEX')} ) right: (ArithWord w:{(Lit_Digits 8)}) ) ) right: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$AUTO_START_INDEX')}) right: (ArithWord w:{(Lit_Digits 12)}) ) ) right: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$AUTO_START_INDEX')}) right: (ArithWord w:{(Lit_Digits 13)}) ) ) spids: [747 780] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(sed)} {(-i)} {(SQ <'/framebuffer_width=/c\\framebuffer_width=854'>)} {(/DietPi/config.txt)} ) (C {(sed)} {(-i)} {(SQ <'/framebuffer_height=/c\\framebuffer_height=480'>)} {(/DietPi/config.txt)} ) ] spids: [16777215 783] ) ] spids: [16777215 810] ) ] spids: [16777215 741] ) ] spids: [16777215 814] ) (SimpleCommand words: [{(echo)} {(-e)} {(DQ ($ VSub_Name '$AUTO_START_INDEX'))}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/DietPi/dietpi/.dietpi-autostart_index)} ) ] ) (C {(systemctl)} {(daemon-reload)}) ] spids: [176] ) spids: [173 176] ) (FuncDef name: Menu_Main body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:AUTO_START_INDEX) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(cat)} {(/DietPi/dietpi/.dietpi-autostart_index)})] ) left_token: <Left_CommandSub '$('> spids: [862 866] ) } spids: [861] ) ] spids: [861] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:option_name) op: Equal rhs: { (ArrayLiteralPart words: [ {(SQ <0>)} {(SQ <'Console: Manual login (default)'>)} {(SQ <7>)} {(SQ <'Console: Automatic login'>)} {(SQ <6>)} {(SQ <'AmiBerry SDL1: Fast boot'>)} {(SQ <8>)} {(SQ <'AmiBerry SDL1: Standard boot'>)} {(SQ <12>)} {(SQ <'AmiBerry SDL2: Fast boot'>)} {(SQ <13>)} {(SQ <'AmiBerry SDL2: Standard boot'>)} {(SQ <10>)} {(SQ <'CAVA Spectrum'>)} {(SQ <11>)} {(SQ <'Chromium: Without desktop'>)} {(SQ <14>)} {(SQ <'Custom: /var/lib/dietpi/dietpi-autostart/custom.sh'>)} {(SQ <2>)} {(SQ <'Desktops: Automatic login (recommended)'>)} {(SQ <16>)} {(SQ <'Desktops: LightDM login prompt'>)} {(SQ <5>)} {(SQ <DietPi-Cloudshell>)} {(SQ <9>)} {(SQ <'DXX-Rebith: Descent 1/2'>)} {(SQ <15>)} {(SQ <JRiver>)} {(SQ <1>)} {(SQ <Kodi>)} {(SQ <4>)} {(SQ <OpenTyrian>)} {(SQ <3>)} {(SQ <RetroPie>)} ] ) } spids: [872] ) ] spids: [870] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:OPTION) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [ {(whiptail)} {(--title)} {(DQ ($ VSub_Name '$WHIP_TITLE'))} {(--menu)} { (DQ ('Current AutoStart Option: ') ($ VSub_Name '$AUTO_START_INDEX') (Lit_Other '\\') (n) (Lit_Other '\\') ('nNB: If your choice is not ') (EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) ('Console:') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ( ', please ensure required software is installed (or selected for install) in DietPi-Software.' ) ) } {(--cancel-button)} {(DQ (Back))} {(--backtitle)} {(DQ ($ VSub_Name '$WHIP_BACKTITLE'))} {(--default-item)} {(DQ ($ VSub_Name '$AUTO_START_INDEX'))} {(20)} {(75)} {(9)} { (DQ (BracedVarSub token: <VSub_Name option_name> bracket_op: (WholeArray op_id:Lit_At) spids: [1083 1088] ) ) } ] redirects: [ (Redir op: <Redir_GreatAnd '3>&'> fd: 3 arg_word: {(1)} ) (Redir op: <Redir_GreatAnd '1>&'> fd: 1 arg_word: {(2)} ) (Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(3)} ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [1034 1099] ) } spids: [1033] ) ] spids: [1033] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CHOICE) op: Equal rhs: {($ VSub_QMark '$?')} spids: [1102] ) ] spids: [1102] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$CHOICE')}) right: (ArithWord w:{(Lit_Digits 0)}) ) spids: [1109 1118] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:AUTO_START_INDEX) op: Equal rhs: {($ VSub_Name '$OPTION')} spids: [1129] ) ] spids: [1129] ) (C {(Apply_Boot_Index)}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$OPTION')}) right: (ArithWord w:{(Lit_Digits 6)}) ) spids: [1144 1153] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(whiptail)} {(--title)} {(DQ ('AmiBerry: (Fast boot)'))} {(--msgbox)} { (DQ ('AmiBerry: (Fast boot):') (Lit_Other '\\') ('nA highly optimized and tweaked boot mode.') (Lit_Other '\\') ('nThis mode allows for a < 2.5 second boot on a RPi 3, into AmiBerry.') (Lit_Other '\\') (n) (Lit_Other '\\') ('nIf you experience boot issues with this mode, please try (Standard Boot)') ) } {(--backtitle)} {(DQ ($ VSub_Name '$WHIP_BACKTITLE'))} {(14)} {(70)} ) ] spids: [16777215 1156] ) ] spids: [16777215 1194] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$OPTION')}) right: (ArithWord w:{(Lit_Digits 14)}) ) spids: [1204 1213] ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-f)} {(/var/lib/dietpi/dietpi-autostart/custom.sh)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(mkdir)} {(-p)} {(/var/lib/dietpi/dietpi-autostart)}) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(_EOF_)} here_end_span_id: 1277 stdin_parts: [ ('#!/bin/bash\n') ('#---Examples---\n') ('\n') ('# - Chromium\n') ('#xinit chromium\n') ('\n') ('# - LXDE\n') ('#startx\n') ('\n') ('# - Print hello\n') ('#echo -e ') (Right_DoubleQuote '"') (Hello) (Right_DoubleQuote '"') ('\n') ('\n') ('#---Put your code below this line---\n') ('\n') ] ) (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/var/lib/dietpi/dietpi-autostart/custom.sh)} ) ] ) (C {(chmod)} {(Lit_Other '+') (x)} {(/var/lib/dietpi/dietpi-autostart/custom.sh)} ) (C {(whiptail)} {(--title)} {(DQ ('Custom: /var/lib/dietpi/dietpi-autostart/custom.sh'))} {(--msgbox)} { (DQ ('A template script has been created:') (Lit_Other '\\') ('n - /var/lib/dietpi/dietpi-autostart/custom.sh') (Lit_Other '\\') (n) (Lit_Other '\\') ( 'nPlease edit this file and enter the required commands you wish to launch. DietPi will then execute this script during boot.' ) ) } {(--backtitle)} {(DQ ($ VSub_Name '$WHIP_BACKTITLE'))} {(14)} {(70)} ) ] spids: [16777215 1237] ) ] spids: [16777215 1326] ) ] spids: [16777215 1216] ) ] spids: [16777215 1330] ) ] spids: [16777215 1121] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TARGETMENUID) op: Equal rhs: {(-1)} spids: [1342] ) ] spids: [1342] ) ] spids: [1334 1347] ) (C {(unset)} {(option_name)}) ] spids: [853] ) spids: [850 853] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$INPUT')}) right: (ArithUnary op_id:Node_UnaryMinus child:(ArithWord w:{(Lit_Digits 1)})) ) spids: [1379 1389] ) terminator: <Op_Semi ';'> ) ] action: [ (WhileUntil keyword: <KW_While while> cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithWord w:{($ VSub_Name '$TARGETMENUID')}) right: (ArithUnary op_id:Node_UnaryMinus child:(ArithWord w:{(Lit_Digits 1)})) ) spids: [1398 1408] ) terminator: <Op_Semi ';'> ) ] body: (DoGroup children: [ (C {(clear)}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$TARGETMENUID')}) right: (ArithWord w:{(Lit_Digits 0)}) ) spids: [1425 1434] ) terminator: <Op_Semi ';'> ) ] action: [(C {(Menu_Main)})] spids: [16777215 1437] ) ] spids: [16777215 1443] ) ] spids: [1411 1446] ) ) ] spids: [16777215 1392] ) (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_GreatEqual left: (ArithWord w:{($ VSub_Name '$INPUT')}) right: (ArithWord w:{(Lit_Digits 0)}) ) spids: [1456 1465] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:AUTO_START_INDEX) op: Equal rhs: {($ VSub_Name '$INPUT')} spids: [1472] ) ] spids: [1472] ) (C {(Apply_Boot_Index)}) ] spids: [1454 1468] ) ] spids: [16777215 1480] ) (ControlFlow token:<ControlFlow_Exit exit>) ] spids: [3] )