Created
August 30, 2012 04:45
-
-
Save zoek1/3522429 to your computer and use it in GitHub Desktop.
Test de plymouth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function check_root { | |
if [ ! `id -u` -eq 0 ]; then | |
echo ¡ Debes de ser root !; | |
exit; | |
fi | |
} | |
check_root | |
IFSS=${IFS} | |
while getopts "hm:t:p:" flag | |
do | |
case ${flag} in | |
t) REPETICIONES=${OPTARG}; | |
echo Seteando el tiempo a ${REPETICIONES} | |
;; | |
m) MODO=${OPTARG}; | |
echo Seteando el modo a ${OPTARG} | |
;; | |
p) PASSWORD=0 | |
PARAMS=${OPTARG} | |
echo Lectura de contraseña | |
;; | |
h) echo "Opciones de plymouth-test:"; | |
echo -e "\t-t TIEMPO - Tiempo de duracion de la imagen"; | |
echo -e "\t-m MODO - Estado del plymouth"; | |
echo -e "\t\t Opciones: boot, shutdown"; | |
echo -e "\t-p (--prompt='PROMPT':--command='COMMAND')"; | |
echo -e "\t\t Opciones: PROMPT - Mensaje a mostrar al pedir la contraseña"; | |
echo -e "\t\t COMMAND - Comando a ejecutar con la constraseña obtenida"; | |
exit; | |
esac | |
done | |
MODO=${MODO:-"boot"}; | |
REPETICIONES=${REPETICIONES:-20}; | |
# Inicia el demonio del plymouth | |
plymouthd --mode=${MODO}; | |
# Muestra el plymouth - inicio grafico | |
plymouth --show-splash; | |
if [[ $PASSWORD ]]; then | |
IFS=":" | |
echo ${PARAMS} | |
plymouth ask-for-password ${PARAMS}; | |
IFS=$IFSS | |
fi | |
# Actualizacion del estado de plymouth | |
for ((i=0; i<$REPETICIONES; i++)) | |
do | |
sleep 1; | |
plymouth --update=event${i}; | |
printf "\rEstado - %d" ${i}; | |
done | |
echo "" | |
# Sale de plymouth | |
plymouth --quit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment