-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·42 lines (41 loc) · 1.86 KB
/
install.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
get_programs2install() {
curl -fsSL https://raw.githubusercontent.com/rhuan-pk/mydump/master/lib/common-properties.lib | grep -Ei '^(programs2install)' | cut -d '=' -f 2 | tr -d "'"
}
cd /tmp
mydump_install_path='/opt/mydump'
mydump_desktop="/home/${USER}/.local/share/applications/mydump.desktop"
sudo apt install curl -y
sudo apt install $(get_programs2install) -y
[ -e ${mydump_install_path} ] && {
sudo rm -rfv ${mydump_install_path}
sudo rm -fv /usr/local/bin/mydump
sudo rm -fv /usr/local/bin/mydump-start
}
[ -e /usr/local/lib/mydump -o -e /usr/local/share/mydump ] && {
sudo rm -rfv /usr/local/lib/mydump
sudo rm -rfv /usr/local/share/mydump
}
sudo mkdir -pv /usr/local/lib/mydump
sudo mkdir -pv /usr/local/share/mydump/{icons,banner}
sudo git clone 'https://github.com/rhuan-pk/mydump.git' "${mydump_install_path}"
sudo chown -Rv ${USER}:${USER} ${mydump_install_path}/
sudo ln -sfv ${mydump_install_path}/bin/mydump-coleta.sh /usr/local/bin/mydump
sudo ln -sfv ${mydump_install_path}/bin/mydump-principal.sh /usr/local/bin/mydump-principal
sudo ln -sfv ${mydump_install_path}/bin/mydump-start.sh /usr/local/bin/mydump-start
sudo ln -sfv ${mydump_install_path}/bin/mydump-update.sh /usr/local/bin/mydump-update
sudo ln -sfv ${mydump_install_path}/bin/loading-bar.sh /usr/local/bin/loading-bar
sudo ln -sfv ${mydump_install_path}/lib/common-properties.lib /usr/local/lib/mydump/common-properties.lib
sudo ln -sfv ${mydump_install_path}/share/icons/logo.png /usr/local/share/mydump/icons/logo.png
sudo ln -sfv ${mydump_install_path}/share/banner/banner.txt /usr/local/share/mydump/banner/banner.txt
rm -fv ${mydump_desktop}
cat << EOF | tee ${mydump_desktop}
[Desktop Entry]
Encoding=UTF-8
Name=MyDump
Icon=/usr/local/share/mydump/icons/logo.png
Exec=mydump-start
Terminal=false
Type=Application
EOF
sudo chmod -v +x ${mydump_desktop}