#!/bin/sh # set aoe to autoload by installing the # aliases in /etc/modprobe.d/ global f := '/etc/modprobe.d/aoe.conf' if test ! -r $f || test ! -w $f { echo "cannot configure $f for module autoloading" !1 > !2 exit 1 } grep major-152 $f >/dev/null if test $Status = 1 { echo alias block-major-152 aoe >> $f echo alias char-major-152 aoe >> $f } (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:f) op:Equal rhs:{(/etc/modprobe.d/aoe.conf)} spids:[10])] spids: [10] ) (If arms: [ (if_arm cond: [ (Sentence child: (AndOr children: [ (C {(test)} {(KW_Bang "!")} {(-r)} {($ VSub_Name "$f")}) (C {(test)} {(KW_Bang "!")} {(-w)} {($ VSub_Name "$f")}) ] op_id: Op_DPipe ) terminator: ) ] action: [ (SimpleCommand words: [ {(echo)} {(DQ ("cannot configure ") ($ VSub_Name "$f") (" for module autoloading"))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[46])] ) (C {(exit)} {(1)}) ] spids: [-1 35] ) ] spids: [-1 54] ) (SimpleCommand words: [{(grep)} {(major-152)} {($ VSub_Name "$f")}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[63])] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_QMark "$?")} {(Lit_Other "=")} {(1)} {(Lit_Other "]")}) terminator: ) ] action: [ (SimpleCommand words: [{(echo)} {(alias)} {(block-major-152)} {(aoe)}] redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{($ VSub_Name "$f")} spids:[90])] ) (SimpleCommand words: [{(echo)} {(alias)} {(char-major-152)} {(aoe)}] redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{($ VSub_Name "$f")} spids:[103])] ) ] spids: [-1 79] ) ] spids: [-1 107] ) ] )