forked from justalinko/diman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
133 lines (128 loc) · 3.86 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
#################################################
# c0ded by : shutdown57 a.k.a alinko #
# Copyright (c) 2016 || Dec 11 2016 #
# Diman (DiskManager) || Debian Based #
# Version 1.2 codename KopiHitam #
# https://github.com/alintamvanz/diman #
# [email protected] - linuxcode.org #
#################################################
# You can edit , redistribute and copying This file Under GPL (General Public License v3)
m="\033[1;31m"
k="\033[1;33m"
h="\033[1;32m"
b="\033[1;34m"
n="\033[1;0m"
clear
clear
clear
echo -e $m" $h "$n
echo -e $m" _______________ $h |*\_/*|________ "$n
echo -e $m" | ___________ | $h ||_/-\_|______ | "$n
echo -e $m" | | > < | | $h | | 0 < | | "$n
echo -e $m" | | - | | $h | | - | | "$n
echo -e $m" | | \___/ | | $h | | \___/ | | "$n
echo -e $m" |_____|\_/|_____| $h |_______________| "$n
echo -e $m" / ********** \......$h..... / ********** \ "$n
echo -e $m" / ************ \ $h / ************ \ "$n
echo -e $m" -------------------- $h -------------------- "$n
echo -e $m"+-----------------------$h------------------------+"$n
echo "> DISK MANAGER INSTALLER SCRIPT "
echo "> Coded by : alinko (shutdown57)"
CheckDepen(){
echo -e $h"[!] Check Dependencies.."$n
sleep 1
which xterm > /dev/null 2>&1
if [[ "$?" -eq "0" ]]; then
echo -e $h"[!] Check :$k Xterm Installed."$n
else
echo -e $h"[!] Check :$m Xterm not installed :("
echo -e $b"Try 'apt-get install xterm' to install it."
exit 1
fi
sleep 1
which gksu > /dev/null 2>&1
if [[ "$?" -eq "0" ]]; then
echo -e $h"[!] Check :$k Gksu Installed"
else
echo -e $h"[!] Check :$m Gksu not installed :("
echo -e $b"Try 'apt-get install gksu' to install it."
exit 1
fi
sleep 1
which mkfs > /dev/null 2>&1
if [[ "$?" -eq "0" ]]; then
echo -e $h"[!] Check :$k Mkfs Installed"
else
echo -e $h"[!] Check :$m mkfs not installed :("
echo -e $b"Try 'apt-get install mkfs' to install it."
exit 1
fi
sleep 1
}
dInstall(){
echo -e $h"[+] INSTALL : $b Copying diman.sh files.."$n
cp diman.sh /usr/bin/diman
sleep 1
echo -e $h"[+] INSTALL : $b Creating desktop icon.."$n
cp desktop/diman.desktop /usr/share/applications/diman.desktop
sleep 1
echo -e $h"[+] INSTALL : $b Creating Directory /opt/diman.."$n
mkdir /opt/diman
cp install /opt/diman
sleep 1
echo -e $h"[+] INSTALL : $b Copying Icon files.."$n
cp desktop/diman.png /opt/diman/
chmod 777 -R /opt/diman
sleep 1
echo -e $h"[+] INSTALLATION FINISHED"$n
}
dUninstall(){
echo -e $m"[-] UNINSTALL : $b Removing diman..."
rm /usr/bin/diman
sleep 1
echo -e $m"[-] UNINSTALL : $b Removing desktop icon.."
rm /usr/share/applications/diman.desktop
sleep 1
echo -e $m"[-] UNINSTALL : $b Removing diman logfiles.."
rm /opt/diman/*
rmdir /opt/diman
sleep 1
echo -e $m"[-] DIMAN UNINSTALLED [-]"$n
}
if [[ `whoami` == "root" ]]; then
case $1 in
"--install" )
CheckDepen
dInstall
;;
"--uninstall" )
dUninstall
;;
"--license" )
cat LICENSE.txt > /dev/null 2>&1
if [[ "$?" -eq "0" ]]; then
more LICENSE.txt
else
echo "LICENSE.txt was missing."
fi
;;
"--about" )
echo "Diman free software."
echo "Manage linux disk with diman."
echo "Version : 1.2 codename KopiHitam"
echo "Author : alinko a.k.a shutdown57"
;;
*)
echo "USAGE :"
echo "--install : For install diman."
echo "--uninstall : For uninstall diman."
echo "--license : For display license this software."
echo "--about : For Know about this software."
echo "EXAMPLES :"
echo "./install --install"
;;
esac
else
echo -e $m"[+] $n Please,run it as root."
fi