-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_apps.sh
executable file
·107 lines (94 loc) · 2.86 KB
/
install_apps.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
######################################################
# SoftGeek Romania Nemo actions dependencies install #
######################################################
source $(dirname $0)/lib.sh
#is_root || { error "You are running this as regular user. Run as root" >&2; exit $E_NOTROOT; }
USAGE="Usage: $SCRIPT_NAME {all | install | uninstall | reinstall | installBulky}"
Help() {
notice "Available options for installing sgs.nemo-actions"
notice
notice "Syntax: ./install.sh [all|install|uninstall|reinstall|installBulky|uninstallBulky|listPackages]"
notice "options:"
notice "all Install all packages and Bulky."
notice "install Install only the default packages without Bulky"
notice "uninstall Uninstall the default packages"
notice "reinstall Reinstall the packages and install again"
notice "installBulky Build and install Bulky from sources"
notice "uninstallBulky Remove Bulky from system"
notice "installPyPackages Install only Python packages"
notice "listPackages Show a list of what packages are going to be installed"
notice
}
listPackages() {
printList $(cat packages.list)
}
installPythonPackages() {
info "Install all the Python packages"
pip install -r requirements.txt
}
installPackages() {
info "Installing the must-have pre-requisites"
RED='\033[0;37m'
NC='\033[0m'
while read -r package; do
info "${package} - ${RED}$(packageInfo ${package})${NC}"
DEBIAN_FRONTEND=noninteractive
sudo apt install -yqq -o=Dpkg::Use-Pty=0 ${package} 2>/dev/null >/dev/null
done < <(cat packages.list)
}
removePackages() {
sudo apt -yq remove $(cat packages.list) 2>/dev/null >/dev/null
}
installBulky() {
info "Install necessary apps for build the Bulky..."
sudo apt install -y git dpkg-dev debhelper python3-magic 2>/dev/null >/dev/null
info "Clone the Bulky repository"
sudo git clone https://github.com/linuxmint/bulky.git /tmp/bulky 2>/dev/null >/dev/null
cd /tmp/bulky/
sudo dpkg-buildpackage -uc -us 2>/dev/null >/dev/null
sudo dpkg -i ../bulky*.deb 2>/dev/null >/dev/null
info "Cleanup after bulky clone and build"
sudo rm -R /tmp/bulky
}
removeBulky() {
sudo apt remove -y bulky 2>/dev/null >/dev/null
}
case "$1" in
all)
info "Install all the packages for Nemo actions and Bulky"
installPythonPackages
installPackages
installBulky
;;
install)
info "Install all the packages for Nemo actions"
installPythonPackages
installPackages
;;
uninstall)
removePackages
;;
reinstall)
removePackages
installPackages
;;
installBulky)
info "Build and install the Bulky app"
installBulky
;;
uninstallBulky)
info "Uninstall Bulky from the system"
removeBulky
;;
installPyPackages)
installPythonPackages
;;
listPackages)
listPackages
;;
*)
Help
exit 1
;;
esac