-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmocis.sh
71 lines (70 loc) · 2.42 KB
/
mocis.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
#!/bin/bash
############################################################
# Developed by Store-Host
# Version 0.0.5.0
# Web: https://www.store-host.com
# Store-Host is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
############################################################
# Installation von "dialog
echo "Installing some nessesary tools"
if [ -d "/etc/apt" ]; then
pmgr=apt
fi
if [ -d "/etc/yum" ]; then
pmgr=yum
fi
if [ $pmgr == "apt" ]; then
apt-get upgrade -y &>/dev/null
apt-get install dialog curl git bc -y &>/dev/null
rm /tmp/version.txt
wget https://raw.githubusercontent.com/StoreHost/Mocis.SH/master/sys/version/version.txt -P /tmp/ &>/dev/null
fi
if [ $pmgr == "yum" ]; then
dialog --title "[ M.O.C.I.S ]" --msgbox 'This script is only supported by Debian Systems for now.' 0 0
clear
exit
fi
if
[ $UID -ne 0 ]; then
dialog --no-lines \
--title "[ M.O.C.I.S ]" --msgbox 'This script must be started as "root"!!"' 0 0
clear
exit
fi
############################################################
# Erklaerung Datenverlust
#
DIRECTORY="/usr/share/mocis"
version=$(sed -n '1{p;q}' /usr/share/mocis/sys/version/version.txt)
currentversion=$(sed -n '1{p;q}' /tmp/version.txt)
dialog --title "Agreement" \
--backtitle "Mocis.sh" \
--no-lines \
--yesno "This script is still in development and therefore not yet stable. \n Please only use on your OWN risk!!! \n We can not be held responsible for any damage or damage that may be caused \n Please check our website www.mocis.sh for more info and updates.\n\n Would you like to proceed? " 0 0
response=$?
case $response in
0) echo "starting";;
1) clear exit;;
255) clear echo "[ESC] key pressed.";;
esac
if [ $response = 0 ]
then
if [ "$version" = "$currentversion" ]; then
bash /usr/share/mocis/overlay/welcome
else
if [ -d $DIRECTORY ]; then
echo "Removing old files..."
rm -R /usr/share/mocis/
fi
echo "Installing some nessesary binarys..."
apt-get install aptitude xmlstarlet git -y &>/dev/null
echo "Cloning newest version...."
git clone https://github.com/StoreHost/Mocis.SH.git /usr/share/mocis/
echo "porting to the main Menu..."
bash /usr/share/mocis/overlay/welcome
rm /tmp/version.txt
fi
fi