1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #!/bin/bash
- MODE=$(ls -l /boot/grub/grub.cfg | awk '{print $1}')
-
- if [ "$(printf "%c" "$MODE")" == "-" ];then #First char at MODE(----------)
- :
- else
- exit 1
- fi
-
- TEMP=${MODE#?} #remove first char at MODE and save at $TEMP
-
- printf "%c" "$TEMP" | grep -w "^r$\|^-$"
-
- if [ $? -eq 0 ];then
- :
- else
- exit 1
- fi
-
- TEMP=${TEMP#?}
-
- printf "%c" "$TEMP" | grep -w "^w$\|^-$"
-
- if [ $? -eq 0 ];then
- :
- else
- exit 1
- fi
-
- TEMP=${TEMP#?}
-
- printf "%c" "$TEMP" | grep -w "^-$"
-
- if [ $? -eq 0 ];then
- :
- else
- exit 1
- fi
-
- TEMP=${TEMP#?}
-
- printf "%c" "$TEMP" | grep -w "^-$"
-
- if [ $? -eq 0 ];then
- :
- else
- exit 1
- fi
-
- TEMP=${TEMP#?}
-
- printf "%c" "$TEMP" | grep -w "^-$"
- if [ $? -eq 0 ];then
- :
- else
- exit 1
- fi
-
- TEMP=${TEMP#?}
-
- printf "%c" "$TEMP" | grep -w "^-$"
-
- if [ $? -eq 0 ];then
- :
- else
- exit 1
- fi
-
- TEMP=${TEMP#?}
-
- printf "%c" "$TEMP" | grep -w "^-$"
-
- if [ $? -eq 0 ];then
- :
- else
- exit 1
- fi
-
- TEMP=${TEMP#?}
-
- printf "%c" "$TEMP" | grep -w "^-$"
-
- if [ $? -eq 0 ];then
- :
- else
- exit 1
- fi
-
- TEMP=${TEMP#?}
-
- printf "%c" "$TEMP" | grep -w "^-$"
-
- if [ $? -eq 0 ];then
- :
- else
- exit 1
- fi
|