(CommandList children: [ (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: [ (Sentence child: (C {(systemctl)} {(disable)} {(lightdm.service)}) terminator: <Op_Amp '&'> ) (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [191] ) ] ) (Sentence child: (C {(systemctl)} {(disable)} {(amiberry.service)}) terminator: <Op_Amp '&'> ) (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [208] ) ] ) (Sentence child: (C {(systemctl)} {(disable)} {(amiberry-sdl2.service)}) terminator: <Op_Amp '&'> ) (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [220] ) ] ) (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 249] ) ] spids: [16777215 287] ) (Sentence child: (C {(rm)} {(/etc/systemd/system/dietpi-autostart_custom.service)}) terminator: <Op_Amp '&'> ) (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [300] ) ] ) (Sentence child: (C {(rm)} {(/etc/systemd/system/getty) (Lit_Other '@') (tty1.service.d/autologin.conf)} ) terminator: <Op_Amp '&'> ) (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [317] ) ] ) (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)}) ) ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: 16777215 body: { (DQ ('[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') ) } do_expansion: True here_end: _EOF_ was_filled: T spids: [355] ) (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/etc/systemd/system/dietpi-autostart_custom.service)} spids: [359] ) ] ) (C {(systemctl)} {(enable)} {(dietpi-autostart_custom.service)}) ] spids: [16777215 349] ) (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)}) ) ) ) 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)}) ) ) terminator: <Op_Semi ';'> ) ] action: [(C {(systemctl)} {(enable)} {(amiberry.service)})] spids: [16777215 435] ) ] else_action: [(C {(systemctl)} {(enable)} {(amiberry-sdl2.service)})] spids: [451 463] ) (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: [477 493] ) } ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(echo)} {(-e)} {(DQ ('boot_delay=0') (Lit_Other '\\') (n))}] redirects: [ (Redir op_id: Redir_DGreat fd: 16777215 arg_word: {(/DietPi/config.txt)} spids: [513] ) ] ) ] spids: [16777215 499] ) ] spids: [16777215 519] ) (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: [529 545] ) } ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(sed)} {(-i)} {(SQ <'s/rootwait/rootwait logo.nologo/'>)} {(/boot/cmdline.txt)} ) ] spids: [16777215 551] ) ] spids: [16777215 567] ) (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: [577 593] ) } ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(sed)} {(-i)} {(SQ <'s/rootwait/rootwait loglevel=3/'>)} {(/boot/cmdline.txt)} ) ] spids: [16777215 599] ) ] spids: [16777215 615] ) (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: [625 641] ) } ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(sed)} {(-i)} {(SQ <'s/console=tty1/console=tty3/'>)} {(/boot/cmdline.txt)} ) ] spids: [16777215 647] ) ] spids: [16777215 663] ) ] spids: [391 413] ) (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)}) ) ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (C {(mkdir)} {(-p)} {(/etc/systemd/system/getty) (Lit_Other '@') (tty1.service.d)} ) terminator: <Op_Amp '&'> ) (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [698] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: 16777215 body: { (DQ ('[Service]\n') ('ExecStart=\n') ('ExecStart=-/sbin/agetty --autologin root %I ') ($ VSub_Name '$TERM') ('\n') ) } do_expansion: True here_end: _EOF_ was_filled: T spids: [705] ) (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/etc/systemd/system/getty) (Lit_Other '@') (tty1.service.d/autologin.conf) } spids: [709] ) ] ) ] spids: [671 685] ) ] spids: [16777215 723] ) (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)}) ) ) 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)}) ) ) ) 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 787] ) ] spids: [16777215 814] ) ] spids: [16777215 745] ) ] spids: [16777215 818] ) (SimpleCommand words: [{(echo)} {(-e)} {(DQ ($ VSub_Name '$AUTO_START_INDEX'))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/DietPi/dietpi/.dietpi-autostart_index)} spids: [834] ) ] ) (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: [866 870] ) } spids: [865] ) ] spids: [865] ) (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: [876] ) ] spids: [874] ) (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: [1087 1092] ) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: 3 arg_word: {(1)} spids: [1095] ) (Redir op_id: Redir_GreatAnd fd: 1 arg_word: {(2)} spids: [1098] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(3)} spids: [1101] ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [1038 1103] ) } spids: [1037] ) ] spids: [1037] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CHOICE) op: Equal rhs: {($ VSub_QMark '$?')} spids: [1106] ) ] spids: [1106] ) (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)}) ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:AUTO_START_INDEX) op: Equal rhs: {($ VSub_Name '$OPTION')} spids: [1133] ) ] spids: [1133] ) (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)}) ) ) 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 1160] ) ] spids: [16777215 1198] ) (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)}) ) ) 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_id: Redir_DLess fd: 16777215 body: { (DQ ('#!/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') ) } do_expansion: True here_end: _EOF_ was_filled: T spids: [1254] ) (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/var/lib/dietpi/dietpi-autostart/custom.sh)} spids: [1258] ) ] ) (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 1241] ) ] spids: [16777215 1329] ) ] spids: [16777215 1220] ) ] spids: [16777215 1333] ) ] spids: [16777215 1125] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TARGETMENUID) op: Equal rhs: {(-1)} spids: [1345] ) ] spids: [1345] ) ] spids: [1337 1350] ) (C {(unset)} {(option_name)}) ] spids: [857] ) spids: [854 857] ) (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)})) ) ) terminator: <Op_Semi ';'> ) ] action: [ (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)}) ) ) ) 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)}) ) ) terminator: <Op_Semi ';'> ) ] action: [(C {(Menu_Main)})] spids: [16777215 1440] ) ] spids: [16777215 1446] ) ] spids: [1414 1449] ) ) ] spids: [16777215 1395] ) (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_GreatEqual left: (ArithWord w:{($ VSub_Name '$INPUT')}) right: (ArithWord w:{(Lit_Digits 0)}) ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:AUTO_START_INDEX) op: Equal rhs: {($ VSub_Name '$INPUT')} spids: [1475] ) ] spids: [1475] ) (C {(Apply_Boot_Index)}) ] spids: [1457 1471] ) ] spids: [16777215 1483] ) (ControlFlow token:<ControlFlow_Exit exit>) ] spids: [3] ) ] )