Removed app name uniqueness

This commit is contained in:
Bob Mottram 2016-09-30 23:00:05 +01:00
parent e6fbcf7db0
commit 14fd98f08e
1 changed files with 4 additions and 4 deletions

View File

@ -65,8 +65,8 @@ function remove_app {
if [ ! -f $REMOVED_APPS_FILE ]; then
touch $REMOVED_APPS_FILE
fi
if ! grep -Fxq "$app_name" $REMOVED_APPS_FILE; then
echo "$app_name" >> $REMOVED_APPS_FILE
if ! grep -Fxq "-$app_name" $REMOVED_APPS_FILE; then
echo "-$app_name" >> $REMOVED_APPS_FILE
fi
}
@ -77,7 +77,7 @@ function app_is_removed {
return
fi
if ! grep -Fxq "$app_name" $REMOVED_APPS_FILE; then
if ! grep -Fxq "-$app_name" $REMOVED_APPS_FILE; then
echo "0"
else
echo "1"
@ -90,7 +90,7 @@ function reinstall_app {
return
fi
if [[ $(app_is_removed $app_name) == "1" ]]; then
sed -i "/${app_name}/d" $REMOVED_APPS_FILE
sed -i "/-${app_name}/d" $REMOVED_APPS_FILE
fi
}