Update DEB for Ubuntu

This commit is contained in:
Ximi1970
2020-04-15 23:54:02 +02:00
parent b2fb006970
commit 1a31fc65e5

View File

@@ -9,32 +9,65 @@
#DEB_VENDOR=$(cat /etc/dpkg/origins/default | grep Vendor: | sed -e "s/Vendor: //")
#if [ "$DEB_VENDOR" = "Debian" ] ; then
#fi
if [ "$DEB_VENDOR" = "Debian" ] ; then
EXTENSION="ubuntu-appindicator@ubuntu.com"
CONF_DIR=/etc/dconf/db/local.d
CONF_FILE=00-extensions
echo "To be implemented"
if [ -f $CONF_DIR/$CONF_FILE ] ; then
#
# Edit extensions file
#
grep -q $EXTENSION $CONF_DIR/$CONF_FILE
if [ "$?" == "1" ] ; then
echo "Add"
sed -i -e "s/\(enabled-extensions=\[.*\)\]/\1, '${EXTENSION}'\]/" $CONF_DIR/$CONF_FILE
fi
else
#
# Generate extensions file
#
mkdir -p $CONF_DIR
cat >$CONF_DIR/$CONF_FILE <<EOF
PROF_DIR=/etc/dconf/profile
PROF_FILE=user
if [ -f $PROF_DIR/$PROF_FILE ] ; then
#
# Edit user file
#
grep -q "user-db:user" $PROF_DIR/$PROF_FILE
if [ "$?" = "1" ] ; then
echo "user-db:user" >> $PROF_DIR/$PROF_FILE
fi
grep -q "system-db:local" $PROF_DIR/$PROF_FILE
if [ "$?" = "1" ] ; then
echo "system-db:local" >> $PROF_DIR/$PROF_FILE
fi
else
#
# Generate user file
#
mkdir -p $PROF_DIR
cat >$PROF_DIR/$PROF_FILE <<EOF
user-db:user
system-db:local
EOF
fi
EXTENSION="ubuntu-appindicator@ubuntu.com"
CONF_DIR=/etc/dconf/db/local.d
CONF_FILE=00-extensions
if [ -f $CONF_DIR/$CONF_FILE ] ; then
#
# Edit extensions file
#
grep -q $EXTENSION $CONF_DIR/$CONF_FILE
if [ "$?" = "1" ] ; then
sed -i -e "s/\(enabled-extensions=\[.*\)\]/\1, '${EXTENSION}'\]/" $CONF_DIR/$CONF_FILE
fi
else
#
# Generate extensions file
#
mkdir -p $CONF_DIR
cat >$CONF_DIR/$CONF_FILE <<EOF
[org/gnome/shell]
# List all extensions that you want to have enabled for all users
enabled-extensions=['ubuntu-appindicator@ubuntu.com']
EOF
fi
dconf update
fi
dconf update