Skip to content

Commit

Permalink
refactored scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
ailtonbsj committed May 8, 2019
1 parent 1faff97 commit f2d225e
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.deb
3 changes: 3 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

dpkg-deb -b deb_package .
11 changes: 11 additions & 0 deletions deb_package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Package: proxy-linux
Version: 1.1.3
Installed-Size:
Maintainer: ailtonbsj <[email protected]>
Section: utils
Architecture: all
Priority: optional
Depends: zenity
Homepage: https://github.com/ailtonbsj/proxy-linux
Description: Easy proxy service switching for browsers and others.
Essa ferramenta facilita o chaveamento rápido das configurações de proxy no ambiente linux. Modifica as configurações de proxy dos seguintes apps: Firefox, Google Chrome, Chromium, apt.conf e wgetrc.
30 changes: 30 additions & 0 deletions deb_package/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

cat /etc/passwd | grep '/home/' | \
grep -v 'cups\|syslog' | cut -d ':' -f 1 > /tmp/homes.list

function geraShort {
echo "[Desktop Entry]"
echo "Type=Link"
cat $1 | \
grep "Name=" | head -n1
cat $1 | \
grep "Name[pt_BR]=" | head -n1
cat $1 | \
grep "Icon=" | head -n1
echo "URL=$2"
}

while read USUARIO; do
geraShort /usr/share/applications/proxy-linux.desktop \
/usr/share/applications/proxy-linux.desktop \
> /home/$USUARIO/Desktop/proxy-linux-sc.desktop
geraShort /usr/share/applications/proxy-linux.desktop \
/usr/share/applications/proxy-linux.desktop \
> /home/$USUARIO/Área\ de\ Trabalho/proxy-linux-sc.desktop

runuser -l $USUARIO -c "rm -rf /home/$USUARIO/.cache/"
if [ -f /usr/bin/lxpanelctl ]; then
su - $USUARIO -c "lxpanelctl restart"
fi
done < /tmp/homes.list
9 changes: 9 additions & 0 deletions deb_package/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

cat /etc/passwd | grep '/home/' | \
grep -v 'cups\|syslog' | cut -d ':' -f 6 > /tmp/homes.list

while read BASEDIR; do
rm -rf "$BASEDIR/Desktop/proxy-linux-sc.desktop"
rm -rf "$BASEDIR/Área de Trabalho/proxy-linux-sc.desktop"
done < /tmp/homes.list
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
15 changes: 6 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ else
#Install
apt-get install zenity -y
mkdir /usr/proxy-linux -p
cp main /usr/proxy-linux
cp makeconf /usr/proxy-linux
cp supermain /usr/proxy-linux
cp proxy.png /usr/proxy-linux
cp proxy-linux.desktop /usr/share/applications/
cp proxy-linux-sc.desktop /home/*/Desktop
cp proxy-linux-sc.desktop /home/*/Área\ de\ Trabalho
#Install on Skell
mkdir /etc/skel/Desktop -p
cp proxy-linux-sc.desktop /etc/skel/Desktop
cp -rf deb_package/usr/ /
cp -rf deb_package/etc/ /
cp deb_package/etc/skel/Desktop/proxy-linux-sc.desktop \
/home/*/Desktop
cp deb_package/etc/skel/Desktop/proxy-linux-sc.desktop \
/home/*/Área\ de\ Trabalho
echo "Pronto!"
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "proxy-linux",
"version": "1.1.2",
"version": "1.1.3",
"description": "Easy proxy service switching for browsers and others",
"main": "install.sh",
"scripts": {
Expand Down

0 comments on commit f2d225e

Please sign in to comment.