-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlinux_dash.sh
48 lines (44 loc) · 1.26 KB
/
linux_dash.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
#!/bin/bash
intro()
{
msgbox "With Linux Dash you can monitor your computer and check on system information such as RAM usage, system load, network status and more. It uses a WebServer (apache2) to present the data. Check https://github.com/linux-dash/linux-dash for more details."
CC=$(whiptail --backtitle "$TITLE" --yesno "Do you want to install and configure a Linux Dash now?" 0 0 3>&1 1>&2 2>&3)
if [ $? -eq 0 ]; then
install_linux_dash
fi
}
install_linux_dash()
{
get_updates
apt-get install -y apache2 php5-json php5
if [ $? -ne 0 ]; then
msgbox "Something went wrong during installation."
return 0
fi
# TODO make own .deb packages for this?
wget https://github.com/afaqurk/linux-dash/archive/master.zip -O /var/www/linux-dash.zip
cd /var/www
# TODO check if every step worked?
unzip linux-dash.zip
mv linux-dash-master html/linux-dash
rm -f linux-dash.zip
msgbox "Linux Dash was installed.
You can access Linux Dash by pointing your browser to http://`hostname`/linux-dash/"
# configure? TODO add .htaccess or something?
# configure_linux_dash
start_server
}
configure_linux_dash()
{
return 0
}
start_server()
{
service apache2 restart
if [ $? -ne 0 ]; then
msgbox "Can't start apache2 server, please check logs."
return 0
fi
return 0
}
intro