-
Notifications
You must be signed in to change notification settings - Fork 12
/
postinst
executable file
·29 lines (26 loc) · 1002 Bytes
/
postinst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
set -e
RIGHT="\e["70"\`" # => [ OK ]
OK="$RIGHT [ OK ]"
FAIL="$RIGHT [ FAIL ]"
case "$1" in
configure)
# We have to change the directory in the ppa
if [[ `grep -rl "^deb http://repository.glx-dock.org/" /etc/apt/` ]]; then
echo -e -n "[Cairo-Dock-Team] Repository: \n * Updated your sources.list (repository.glx-dock.org => download.tuxfamily.org/glxdock/repository)"
rm -rf /tmp/cairo-dock-dpkg
mkdir /tmp/cairo-dock-dpkg
for i in `grep -rl "^deb http://repository.glx-dock.org/" /etc/apt/`; do
cp $i /tmp/cairo-dock-dpkg/
done
grep -rl "^deb http://repository.glx-dock.org/" /etc/apt/ | xargs sed -i "s/http:\/\/repository\.glx-dock\.org/http:\/\/download.tuxfamily.org\/glxdock\/repository/g"
if [ $? -eq 0 ]; then
rm -r /tmp/cairo-dock-dpkg
echo -e "$OK"
else
echo -e "$FAIL\nPlease update our ppa (cairo-dock-team/debian/ubuntu) from $BEFORE to $AFTER in your sources.list"
cp -R /tmp/cairo-dock-dpkg/* /etc/apt/
fi
fi
;;
esac