mirror of
https://github.com/vinceliuice/grub2-themes.git
synced 2024-11-05 16:16:14 +01:00
update
This commit is contained in:
parent
aa3e2b3c04
commit
ab5ba9cf78
71
install.sh
71
install.sh
@ -390,39 +390,6 @@ remove() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Show terminal user interface for better use
|
|
||||||
if [[ $# -eq 0 ]]; then
|
|
||||||
if [[ ! -x /usr/bin/dialog ]]; then
|
|
||||||
if [[ $UID -ne $ROOT_UID ]]; then
|
|
||||||
#Check if password is cached (if cache timestamp not expired yet)
|
|
||||||
sudo -n true 2> /dev/null && echo
|
|
||||||
|
|
||||||
if [[ $? == 0 ]]; then
|
|
||||||
#No need to ask for password
|
|
||||||
exec sudo $0
|
|
||||||
else
|
|
||||||
#Ask for password
|
|
||||||
prompt -e "\n [ Error! ] -> Run me as root! "
|
|
||||||
read -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s
|
|
||||||
|
|
||||||
sudo -S echo <<< $REPLY 2> /dev/null && echo
|
|
||||||
|
|
||||||
if [[ $? == 0 ]]; then
|
|
||||||
#Correct password, use with sudo's stdin
|
|
||||||
sudo $0 <<< $REPLY
|
|
||||||
else
|
|
||||||
#block for 3 seconds before allowing another attempt
|
|
||||||
sleep 3
|
|
||||||
prompt -e "\n [ Error! ] -> Incorrect password!\n"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
install_dialog
|
|
||||||
fi
|
|
||||||
run_dialog
|
|
||||||
fi
|
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
PROG_ARGS+=("${1}")
|
PROG_ARGS+=("${1}")
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
@ -543,7 +510,40 @@ while [[ $# -gt 0 ]]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ "${remove:-}" != 'true' ]]; then
|
# Show terminal user interface for better use
|
||||||
|
if [[ $# -eq 0 ]]; then
|
||||||
|
if [[ ! -x /usr/bin/dialog ]]; then
|
||||||
|
if [[ $UID -ne $ROOT_UID ]]; then
|
||||||
|
#Check if password is cached (if cache timestamp not expired yet)
|
||||||
|
sudo -n true 2> /dev/null && echo
|
||||||
|
|
||||||
|
if [[ $? == 0 ]]; then
|
||||||
|
#No need to ask for password
|
||||||
|
exec sudo $0
|
||||||
|
else
|
||||||
|
#Ask for password
|
||||||
|
prompt -e "\n [ Error! ] -> Run me as root! "
|
||||||
|
read -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s
|
||||||
|
|
||||||
|
sudo -S echo <<< $REPLY 2> /dev/null && echo
|
||||||
|
|
||||||
|
if [[ $? == 0 ]]; then
|
||||||
|
#Correct password, use with sudo's stdin
|
||||||
|
sudo $0 <<< $REPLY
|
||||||
|
else
|
||||||
|
#block for 3 seconds before allowing another attempt
|
||||||
|
sleep 3
|
||||||
|
prompt -e "\n [ Error! ] -> Incorrect password!\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
install_dialog
|
||||||
|
fi
|
||||||
|
run_dialog
|
||||||
|
install "${theme}" "${icon}" "${screen}"
|
||||||
|
else
|
||||||
|
if [[ "${remove:-}" != 'true' ]]; then
|
||||||
for theme in "${themes[@]-${THEME_VARIANTS[0]}}"; do
|
for theme in "${themes[@]-${THEME_VARIANTS[0]}}"; do
|
||||||
for icon in "${icons[@]-${ICON_VARIANTS[0]}}"; do
|
for icon in "${icons[@]-${ICON_VARIANTS[0]}}"; do
|
||||||
for screen in "${screens[@]-${SCREEN_VARIANTS[0]}}"; do
|
for screen in "${screens[@]-${SCREEN_VARIANTS[0]}}"; do
|
||||||
@ -551,10 +551,11 @@ if [[ "${remove:-}" != 'true' ]]; then
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
elif [[ "${remove:-}" == 'true' ]]; then
|
elif [[ "${remove:-}" == 'true' ]]; then
|
||||||
for theme in "${themes[@]-${THEME_VARIANTS[0]}}"; do
|
for theme in "${themes[@]-${THEME_VARIANTS[0]}}"; do
|
||||||
remove "${theme}"
|
remove "${theme}"
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user