forked from ivan-hc/AM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
79 lines (63 loc) · 3.5 KB
/
INSTALL
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
#!/bin/sh
# CREATING THE MAIN FOLDER FOR "AM"
mkdir /opt/am /opt/am/.cache
cd /opt/am
# DOWNLOAD THE MAIN SCRIPT
wget https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/APP-MANAGER
chmod a+x /opt/am/APP-MANAGER
# LINK THE MAIN SCRIPT TO A KNOWN PATH
ln -s /opt/am/APP-MANAGER /usr/local/bin/am
# CREATE THE SCRIPT NEEDED TO UNINSTALL "AM"
rm -R -f /opt/am/remove
echo "#!/bin/sh
rm -R -f /usr/local/bin/am /opt/am /etc/bash_completion.d/am-completion.sh" >> /opt/am/remove
chmod a+x /opt/am/remove
# DOWNLOAD THE LIST OF THE AVAILABLE PROGRAMS
am -l
# ENABLE NON-ROOT PERMISSIONS TO THE MAIN FOLDER FOR THE CURRENT USER
currentuser=$(who | awk '{print $1}')
chown -R $currentuser /opt/am
# ADD THE BASH COMPLETION SCRIPT
echo '#!/usr/bin/env bash' >> /opt/am/am-completion.sh; echo 'complete -W "$(cat /opt/am/list 2>/dev/null)" am' >> /opt/am/am-completion.sh
chmod a+x /opt/am/am-completion.sh
rm -R -f /opt/am/remove; echo '#!/bin/sh' >> /opt/am/remove
echo 'rm -R -f /usr/local/bin/am /opt/am /etc/bash_completion.d/am-completion.sh' >> /opt/am/remove
chmod a+x /opt/am/remove; chown -R $currentuser /opt/am/remove 2>/dev/null
if test -f /etc/bash_completion.d; then
mv /opt/am/am-completion.sh /etc/bash_completion.d/
else
mkdir -p /etc/bash_completion.d; sudo mv /opt/am/am-completion.sh /etc/bash_completion.d/
fi
# SHOW THE MESSAGE
clear
echo '
------------------------------------------------------------------------
_____ _____
/\ \ /\ \
/::\ \ /::\____\
/::::\ \ /::::| |
/::::::\ \ /:::::| |
/:::/\:::\ \ /::::::| |
/:::/__\:::\ \ /:::/|::| |
/::::\ \:::\ \ /:::/ |::| |
/::::::\ \:::\ \ /:::/ |::|___|______
/:::/\:::\ \:::\ \ /:::/ |::::::::\ \
/:::/ \:::\ \:::\____\/:::/ |:::::::::\____\
\::/ \:::\ /:::/ /\::/ / ~~~~~/:::/ /
\/____/ \:::\/:::/ / \/____/ /:::/ /
\::::::/ / /:::/ /
\::::/ / /:::/ /
/:::/ / /:::/ /
/:::/ / /:::/ /
/:::/ / /:::/ /
/:::/ / /:::/ /
\::/ / \::/ /
\/____/ \/____/
▄▀█ █▀█ █▀█ █░░ █ █▀▀ ▄▀█ ▀█▀ █ █▀█ █▄░█ █▀▄▀█ ▄▀█ █▄░█ ▄▀█ █▀▀ █▀▀ █▀█
█▀█ █▀▀ █▀▀ █▄▄ █ █▄▄ █▀█ ░█░ █ █▄█ █░▀█ █░▀░█ █▀█ █░▀█ █▀█ █▄█ ██▄ █▀▄
by Ivan Alex HC
------------------------------------------------------------------------
>> Enjoy your applications without thinking about anything else <<
-----------------------------------------------------------------------
SITE: https://github.com/IVAN-HC/AM-APPLICATION-MANAGER
'