-
Notifications
You must be signed in to change notification settings - Fork 5
/
comfy-chair.sh
executable file
·90 lines (75 loc) · 2.97 KB
/
comfy-chair.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
#!/usr/bin/env bash
# these will run as the default non-privileged user.
# set a version number
VERSION="1.6.0"
# ensure that we are not prompted to restart services during the install process
export DEBIAN_FRONTEND=noninteractive
# make sure we are running under a Debian-based OS, as this script needs the
# 'apt' command and their specific packages.
debian=`dpkg --version | grep "Debian"`
if [ -z "$debian" ]; then
echo "This script is only for Debian-based systems."
exit 1
fi
# get the 'flavour' of this OS, ie debian,ubuntu etc
flavour=$(tr '[:upper:]' '[:lower:]' <<< `lsb_release -is`)
# lets see if we are running under WSL (Windows Subsystem for Linux)
read osrelease </proc/sys/kernel/osrelease
if [[ $osrelease =~ "WSL" ]]; then
os="wsl"
else
os="linux"
fi
echo "Linux Comfy Chair v$VERSION (c) Grant Ramsay (seapagan@gmail.com)"
if [ $os = "wsl" ]; then
echo " - Running under the 'Windows Subsystem for Linux (WSL)"
fi
# save the path to this script for later use
THISPATH="$(dirname $(readlink -f "$0"))"
echo
echo "We are running from : $THISPATH"
echo
# make sure we have Git and sudo installed already. Some very minimal images
# will not have these (eg the standard Ubuntu Docker image)
if [ ! $(which git) ] || [ ! $(which sudo) ]; then
echo "Git or/and Sudo are not installed, please install these and restart."
exit 1
fi
# if this is a minimized system (eg ex Docker container) then the 'man' command
# will be diverted to a stub. Lets set this back to the real Binary
# Note : Without this the Perl installation will FAIL tests.
if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then
# Remove diverted man binary
sudo rm -f /usr/bin/man
sudo dpkg-divert --quiet --remove --rename /usr/bin/man
# remove the reminder from the MOTD
sudo rm -f /etc/update-motd.d/60-unminimize
fi
# source in the configuration file..
. $THISPATH/comfy.config
# run the individual modules. This will be changed to read from an array of
# modules..
. $THISPATH/modules/updates.sh $flavour
. $THISPATH/modules/packages.sh
# WSL Specific work
if [ $os = "wsl" ]; then
. $THISPATH/modules/wsl.sh
fi
# ---------------------------------------------------------------------------- #
# comment out the modules below you do not want to run #
# ---------------------------------------------------------------------------- #
# . $THISPATH/modules/nginx-php-pgsql.sh
. $THISPATH/modules/rust.sh
. $THISPATH/modules/docker.sh
. $THISPATH/modules/ruby.sh
. $THISPATH/modules/node.sh
. $THISPATH/modules/python.sh
. $THISPATH/modules/perl.sh
. $THISPATH/modules/extras.sh
# ---------------------------------------------------------------------------- #
# end of modules #
# ---------------------------------------------------------------------------- #
# cleanup after ourselves
. $THISPATH/modules/cleanup.sh
echo
echo "You now need to reboot this system for all the new changes to take affect."