All pastes #2066410 Raw Edit

Untitled

public text v1 · immutable
#2066410 ·published 2011-05-22 00:33 UTC
rendered paste body
ubuntu@ubuntu:~/Downloads$ ./indisguise 
#!/bin/bash
#SCHEMA="com.canonical.Unity.Panel"
#OBJECT="systray-whitelist"
#APP="$1"
#if [ ! "$(gsettings get $SCHEMA $OBJECT 2>/dev/null || echo FALSE)" = "FALSE" ]; then
# echo "Whitelisting $APP to work around flawed distribution design.."
# OBJARRAY=$(gsettings get $SCHEMA $OBJECT | sed -s -e "s#\['##g" -e "s#', '# #g" -e "s#'\]##g")
# if [[ "${OBJARRAY[@]}" =~ "$APP" ]]; then
# echo "$APP already whitelisted, skipping"
# else
# OBJARRAY=("${OBJARRAY[@]}" $APP)
# OBJARRAY=$(echo ${OBJARRAY[@]} | sed -s -e "s# #', '#g")
# OBJSET="['"$OBJARRAY"']"
# gsettings set $SCHEMA $OBJECT "$OBJSET"
# fi
#else
# echo "This is not a Canonical designed product."
#fi

SCHEMA="com.canonical.Unity.Panel"
OBJECT="systray-whitelist"
APP="indisguise"
if [ ! "$(gsettings get $SCHEMA $OBJECT 2>/dev/null || echo FALSE)" = "FALSE" ]; then
	echo "Whitelisting $APP to work around flawed distribution design.."
	OBJARRAY=$(gsettings get $SCHEMA $OBJECT | sed -s -e "s#\['##g" -e "s#', '# #g" -e "s#'\]##g")
	if [[ "${OBJARRAY[@]}" =~ "$APP" ]]; then
		echo "$APP already whitelisted, skipping"
	else
		OBJARRAY="${OBJARRAY[@]}" $APP
		OBJARRAY=$(echo ${OBJARRAY[@]} | sed -s -e "s# #', '#g")
		OBJSET="['"$OBJARRAY"']"
		gsettings set $SCHEMA $OBJECT "$OBJSET"
	fi
else
	echo "Error"
fi


Whitelisting indisguise to work around flawed distribution design..
sh: Bad substitution