aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-11-25 13:35:52 +0100
committerKarel Kočí <cynerd@email.cz>2018-11-25 13:35:52 +0100
commit13bb00826c7aa9fc545b9f797e5cce4120752a3f (patch)
tree559c8a94c82f390cf96441f10428bca783e0406f /utils
parent060741fdc9dd88dd0d99edffb76ae0cb8afac273 (diff)
downloadmyconfigs-13bb00826c7aa9fc545b9f797e5cce4120752a3f.tar.gz
myconfigs-13bb00826c7aa9fc545b9f797e5cce4120752a3f.tar.bz2
myconfigs-13bb00826c7aa9fc545b9f797e5cce4120752a3f.zip
Cleanup and more
I am just lazy to write it up. Nobody reads it anyway.
Diffstat (limited to 'utils')
-rw-r--r--utils/inst13
1 files changed, 9 insertions, 4 deletions
diff --git a/utils/inst b/utils/inst
index 9987fff..34b2e87 100644
--- a/utils/inst
+++ b/utils/inst
@@ -1,14 +1,19 @@
# Functions used for interactive installation of new changes to running system
# vim: ft=sh
+# Ask if given section should be installed
+# First argument is name (take care not to use special characters for regulard
+# expression) and second argument is a question
ask() {
+ grep -q "^$1$" ".ignore-$(hostname)" && return 1
if $FORCE; then
- echo -e "\e[1;34m$1\e[0m"
+ echo "\e[1;34m$2\e[0m"
# Fall trough with 0 exit (always yes)
else
- echo -e -n "\e[1;34m$1? (Y/n) \e[0m"
- read
- echo "$REPLY" | grep -qE '^[Yy]?$'
+ echo -e -n "\e[1;34m$2? (Y/n) \e[0m"
+ local reply
+ read -r reply
+ echo "$reply" | grep -qE '^[Yy]?$'
fi
}