├── CREDITS.md
├── LICENSE
├── README.md
├── config.ini
├── config.sh
├── documents
├── Increasing HTTP Upload Limit.txt
└── Using Extra Scripts.txt
├── external
├── cms-wordpress.sh
├── database-adminer.sh
├── database-phpmyadmin.sh
└── modules
│ ├── configure-database-mysql
│ ├── config.ini
│ ├── init.sh
│ └── mysql
│ │ └── conf.d
│ │ ├── disable_innodb.cnf
│ │ └── minimal.cnf
│ ├── configure-database-postgresql
│ ├── config.ini
│ └── init.sh
│ ├── manage-add-host
│ ├── config.ini
│ └── init.sh
│ ├── manage-http.sh
│ ├── manage-manage-host
│ ├── config.ini
│ └── init.sh
│ └── manage-remove-host
│ ├── config.ini
│ └── init.sh
├── libraries
├── 10.distribution.sh
├── 10.platform.sh
├── 20.message.sh
├── 20.test.sh
├── 30.configuration.sh
├── 30.module.sh
├── 40.check.sh
├── 40.package.sh
├── 40.replace.sh
├── default
│ ├── config.ini
│ └── launcher.sh
├── external
│ ├── question.sh
│ └── read_ini.sh
├── module
│ ├── common-clean.sh
│ └── manage-user.sh
└── platform
│ ├── check.debian.sh
│ ├── check.ubuntu.sh
│ ├── clean.debian-6.sh
│ ├── clean.debian-7.sh
│ ├── clean.ubuntu-1204.sh
│ ├── daemon.debian-6.sh
│ ├── daemon.debian-7.sh
│ ├── daemon.ubuntu-1204.sh
│ ├── package.debian.sh
│ └── package.ubuntu.sh
├── minstall.sh
└── modules
├── clean-packages
├── config.ini
├── custom
│ └── custom
├── debian-6
│ ├── base-hardware-x32
│ ├── base-hardware-x64
│ ├── base-x32
│ ├── base-x64
│ ├── script-post.sh
│ ├── script-pre.sh
│ ├── specific-hardware-x32
│ ├── specific-hardware-x64
│ ├── specific-xenpv-x32
│ └── specific-xenpv-x64
├── debian-7
│ ├── base-hardware-x32
│ ├── base-hardware-x64
│ ├── base-x32
│ ├── base-x64
│ ├── script-post.sh
│ ├── script-pre.sh
│ ├── specific-hardware-x32
│ ├── specific-hardware-x64
│ ├── specific-xenpv-x32
│ └── specific-xenpv-x64
├── init.sh
└── ubuntu-1204
│ ├── base-hardware-x32
│ ├── base-hardware-x64
│ ├── base-x32
│ ├── base-x64
│ ├── script-post.sh
│ ├── script-pre.sh
│ ├── specific-hardware-x32
│ ├── specific-hardware-x64
│ ├── specific-xenpv-x32
│ └── specific-xenpv-x64
├── clean-upgrade
├── config.ini
└── init.sh
├── configure-general-system
├── config.ini
└── init.sh
├── configure-general-user
├── config.ini
├── debian-6
│ ├── .bashrc
│ └── .profile
├── debian-7
│ ├── .bashrc
│ └── .profile
├── init.sh
└── ubuntu-1204
│ ├── .bashrc
│ └── .profile
├── configure-http-nginx
├── config.ini
├── etc
│ └── sites-available
│ │ └── default.conf
└── init.sh
├── configure-terminal-ssh
├── config.ini
└── init.sh
├── help-modules
├── config.ini
└── init.sh
├── help
├── config.ini
└── init.sh
├── install-database-mariadb
├── config.ini
└── init.sh
├── install-database-mongodb
├── config.ini
└── init.sh
├── install-database-mysql
├── config.ini
└── init.sh
├── install-database-postgresql
├── config.ini
└── init.sh
├── install-database-redis
├── config.ini
└── init.sh
├── install-extra-packages
├── config.ini
└── init.sh
├── install-extra-repositories
├── config.ini
├── debian-6
│ ├── debian-multimedia.sh
│ ├── default.sh
│ ├── dotdeb.sh
│ ├── mariadb.sh
│ ├── mongodb.sh
│ ├── nginx.sh
│ ├── plex.sh
│ ├── postgresql.sh
│ ├── proxmox.sh
│ └── webupd8-java.sh
├── debian-7
│ ├── debian-multimedia.sh
│ ├── default.sh
│ ├── dotdeb.sh
│ ├── mariadb.sh
│ ├── mongodb.sh
│ ├── nginx.sh
│ ├── nodejs.sh
│ ├── plex.sh
│ ├── postgresql.sh
│ ├── proxmox.sh
│ └── webupd8-java.sh
├── init.sh
└── ubuntu-1204
│ ├── default.sh
│ ├── mariadb.sh
│ ├── medibuntu.sh
│ ├── mongodb.sh
│ ├── nginx.sh
│ ├── nodejs.sh
│ ├── plex.sh
│ ├── postgresql.sh
│ └── webupd8-java.sh
├── install-framework-node
├── config.ini
└── init.sh
├── install-framework-php
├── config.ini
├── etc
│ └── php5
│ │ └── fpm
│ │ └── pool.d
│ │ └── www-data.conf
└── init.sh
├── install-framework-python
├── config.ini
└── init.sh
├── install-framework-ruby
├── config.ini
└── init.sh
├── install-http-nginx
├── config.ini
├── etc
│ └── nginx
│ │ ├── conf.d
│ │ ├── cache.conf
│ │ └── deny.conf
│ │ ├── custom.d
│ │ ├── default.conf
│ │ └── system.conf
│ │ ├── fastcgi_params
│ │ ├── nginx.conf
│ │ ├── nginx.d
│ │ ├── gzip.conf
│ │ ├── proxy_cache.conf
│ │ └── ssl_session_cache.conf
│ │ ├── php.d
│ │ └── www-data.conf
│ │ ├── sites-available
│ │ ├── default.conf
│ │ └── system.conf
│ │ └── ssl.d
│ │ ├── self.key
│ │ └── self.pem
└── init.sh
├── install-mail-exim
├── config.ini
└── init.sh
├── install-network-dnsmasq
├── config.ini
└── init.sh
├── install-network-openvpn
├── config.ini
└── init.sh
├── install-network-pptp
├── config.ini
└── init.sh
├── install-network-softether
├── config.ini
└── init.sh
├── install-security-fail2ban
├── config.ini
└── init.sh
├── install-security-logwatch
├── config.ini
└── init.sh
├── install-security-sudo
├── config.ini
└── init.sh
├── install-security-unattended-upgrades
├── config.ini
└── init.sh
├── install-terminal-openssh
├── config.ini
├── etc
│ └── ssh
│ │ ├── ssh_config
│ │ └── sshd_config
└── init.sh
├── install-torrent-deluge
├── config.ini
└── init.sh
├── install-torrent-rtorrent
├── config.ini
└── init.sh
├── manage-user-add
├── config.ini
└── init.sh
├── manage-user-manage
├── config.ini
└── init.sh
└── manage-user-remove
├── config.ini
└── init.sh
/CREDITS.md:
--------------------------------------------------------------------------------
1 | General
2 | =======
3 |
4 | **KnightSwarm Handelsbolag**
5 |
6 | + Sponsored development, provided direction.
7 |
8 | **Zsolt Ero:**
9 |
10 | + Helped fix countless bugs, wrote a host manager and provided many good suggestions.
11 |
12 | Functions
13 | =========
14 |
15 | **extra/install-phpmyadmin:**
16 |
17 | + http://www.legroom.net/2010/05/06/bash-random-password-generator/
18 |
19 | **libraries/external/question.sh:**
20 |
21 | + http://www.linuxjournal.com/content/asking-yesno-question-bash-script/
22 |
23 | **libraries/external/read_ini.sh:**
24 |
25 | + http://www.github.com/rudimeier/bash_ini_parser/
26 |
27 | **libraries/platform/check.debian.sh:**
28 |
29 | + http://www.servercobra.com/bash-check-if-package-is-installed/
30 |
31 | **libraries/10.distribution.sh:**
32 |
33 | + http://www.doxer.org/learn-linux/linux-shell-centos-debian-ostype/
34 |
35 | **libraries/20.message.sh:**
36 |
37 | + http://www.linuxjournal.com/content/asking-yesno-question-bash-script/
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | This program is free software: you can redistribute it and/or modify
2 | it under the terms of the GNU General Public License as published by
3 | the Free Software Foundation, either version 3 of the License, or
4 | (at your option) any later version.
5 |
6 | This program is distributed in the hope that it will be useful,
7 | but WITHOUT ANY WARRANTY; without even the implied warranty of
8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 | GNU General Public License for more details.
10 |
11 | You should have received a copy of the GNU General Public License
12 | along with this program. If not, see .
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | **Description**
2 | An all in one script designed to minimize a server install and manage all services.
3 |
4 | **Compatibility**
5 |
6 | - **Operating Systems:**
7 | - Debian 6 (Squeeze) 64 Bit
8 | - Debian 6 (Squeeze) 32 Bit
9 | - Debian 7 (Wheezy) 64 Bit (WIP)
10 | - Debian 7 (Wheezy) 32 Bit (WIP)
11 | - **Platforms:**
12 | - Hardware
13 | - KVM
14 | - OpenVZ
15 | - VirtualBox
16 | - VMware
17 | - Xen HVM
18 |
19 | **Notes**
20 | Run on a freshly installed server under root, may not work under an already setup server!
21 |
22 | **Installation**
23 |
24 | To download Minstall run the following command under root:
25 |
26 | wget -O /opt/minstall.tar.gz --no-check-certificate http://www.github.com/KnightSwarm/Minstall/archive/master.tar.gz; mkdir /opt/minstall; tar -C /opt/minstall -f /opt/minstall.tar.gz --strip-components 1 -x -z; ln -s /opt/minstall/libraries/default/launcher.sh /usr/local/bin/minstall; chmod +x /usr/local/bin/minstall
27 |
28 | To remove Minstall run the following command under root:
29 |
30 | rm -rf /opt/minstall /opt/minstall.tar.gz /usr/local/bin/minstall
31 |
32 | **Examples**
33 |
34 | minstall -m install-extra-repositories
35 | minstall -m clean-packages
36 | minstall -m install-terminal-openssh
37 | minstall -m install-extra-packages
38 |
39 | minstall -m configure-general-system
40 | minstall -m configure-terminal-ssh
41 | minstall -m clean-upgrade
42 | minstall -m configure-general-user
43 |
44 | **Warning**
45 | No warranty. Limited support available (although I will try my best to make your experience with the script a good one!)
46 |
--------------------------------------------------------------------------------
/config.ini:
--------------------------------------------------------------------------------
1 | ; Minstall Configuration File
2 | ; ===========================
3 | ; Note: All settings must stay in the format they are in by default, script is not guaranteed to work otherwise!
4 | ; Modules without options are not included.
5 |
6 | ; Minstall Options
7 | ; General options for Minstall, this section must exist as the script will fail if it is removed.
8 | [minstall]
9 | ; Debug Mode
10 | ; This flag pauses the script after each module has been run and enables easier viewing of output. To enable set value to 1, to disable set to 0.
11 | debug=0
12 | ; Enabled Modules
13 | ; Defines the list of enabled modules to be run. Order is taken into account and each module must be separed by a comma with no spaces.
14 | modules=""
15 | ; Automatic Package List Update
16 | ; This flag will enable updating of the system package list prior to the first module running. To enable set value to 1, to disable set to 0.
17 | package_update=1
18 |
--------------------------------------------------------------------------------
/config.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Minstall Default Variable Definitions
3 |
4 | # Default Config
5 | CONFIGFILE=config.ini
6 |
7 | # Library Path
8 | LIBRARYPATH=libraries
9 |
10 | # Module Path
11 | MODULEPATH=modules
12 |
13 | # Default Mode
14 | UNATTENDED=0
15 |
--------------------------------------------------------------------------------
/documents/Increasing HTTP Upload Limit.txt:
--------------------------------------------------------------------------------
1 | Increasing the upload limit is simple, just follow these steps:
2 |
3 | For each user that needs the updated limit append the following to the users config file in /etc/php5/fpm/pool.d/:
4 |
5 | php_value[post_max_size] = 200M
6 | php_value[upload_max_filesize] = 200M
7 |
8 | Also, to enable the increased limit for nginx create a new .conf file in /etc/nginx/nginx.d/ and insert the following:
9 |
10 | client_max_body_size 200M;
11 |
12 | Finally, enable the new limit in suhosin by appending the following to /etc/php5/fpm/conf.d/suhosin.ini:
13 |
14 | suhosin.memory_limit = 200M
15 |
16 | After you're done restart both php-fpm and nginx and you should be good to go!
17 |
--------------------------------------------------------------------------------
/documents/Using Extra Scripts.txt:
--------------------------------------------------------------------------------
1 | Minstall includes some extra scripts. These scripts may be used independantly to Minstall and aren't dependant on it.
2 | Some may however require the changing of parameters in the script files to ensure proper setup and operation.
3 | Please be sure to understand what each script does and update the variables in the variable section of each script before using.
4 | Hopefully you'll find the scripts useful!
5 |
--------------------------------------------------------------------------------
/external/cms-wordpress.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Basic Wordpress Installer
3 |
4 | ###############
5 | ## Variables ##
6 | ###############
7 |
8 | # User (Owner Of Virtual Host)
9 | USER="main"
10 |
11 | # Virtual Host
12 | HOST="host.example.com"
13 |
14 | # Directory Under Virtual Host In Which Script Will Be Installed, Leave Empty For Installation Into Virtual Host Root
15 | DIRECTORY="wordpress"
16 |
17 | # Script URL
18 | URL="http://www.wordpress.org/latest.tar.gz"
19 |
20 | ############
21 | ## Script ##
22 | ############
23 |
24 | # Change Directory
25 | cd /home/$USER/http/hosts/$HOST
26 |
27 | # Check If Directory Variable Empty
28 | if [[ $DIRECTORY != "" ]]; then
29 | # Make Script Directory
30 | mkdir $DIRECTORY
31 |
32 | # Change Directory
33 | cd $DIRECTORY
34 | fi
35 |
36 | # Download Script
37 | wget -O wordpress.tar.gz "$URL"
38 |
39 | # Extract Script
40 | tar xfvz wordpress.tar.gz
41 |
42 | # Move Script
43 | mv wordpress/* .
44 |
45 | # Clean Useless Files
46 | rm -rf license.txt readme.html
47 |
48 | # Update Owner
49 | chown -R $USER:$USER .
50 |
51 | # Update Permissions
52 | chmod -R o= .
53 |
--------------------------------------------------------------------------------
/external/database-adminer.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Basic Adminer Installer
3 |
4 | ###############
5 | ## Variables ##
6 | ###############
7 |
8 | # User (Owner Of Virtual Host)
9 | USER="main"
10 |
11 | # Virtual Host
12 | HOST="host.example.com"
13 |
14 | # Directory Under Virtual Host In Which Script Will Be Installed, Leave Empty For Installation Into Virtual Host Root
15 | DIRECTORY="adminer"
16 |
17 | # Script File Name
18 | NAME="index.php"
19 |
20 | # Script URL
21 | URL="http://www.sourceforge.net/projects/adminer/files/Adminer/Adminer%203.7.1/editor-3.7.1.php/download"
22 |
23 | # Theme URL, Leave Empty For Default
24 | THEME="http://raw.github.com/vrana/adminer/master/designs/pokorny/adminer.css"
25 |
26 | ############
27 | ## Script ##
28 | ############
29 |
30 | # Change Directory
31 | cd /home/$USER/http/hosts/$HOST
32 |
33 | # Check If Directory Variable Empty
34 | if [[ $DIRECTORY != "" ]]; then
35 | # Make Script Directory
36 | mkdir $DIRECTORY
37 |
38 | # Change Directory
39 | cd $DIRECTORY
40 | fi
41 |
42 | # Download Script
43 | wget -O $NAME "$URL"
44 |
45 | # Check If Theme Variable Empty
46 | if [[ $THEME != "" ]]; then
47 | # Download Theme
48 | wget -O adminer.css "$THEME"
49 | fi
50 |
51 | # Update Owner
52 | chown -R $USER:$USER .
53 |
54 | # Update Permissions
55 | chmod -R o= .
56 |
--------------------------------------------------------------------------------
/external/database-phpmyadmin.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Basic phpMyAdmin Installer
3 |
4 | ###############
5 | ## Variables ##
6 | ###############
7 |
8 | # User (Owner Of Virtual Host)
9 | USER="main"
10 |
11 | # Virtual Host
12 | HOST="host.example.com"
13 |
14 | # Directory Under Virtual Host In Which Script Will Be Installed, Leave Empty For Installation Into Virtual Host Root
15 | DIRECTORY="phpmyadmin"
16 |
17 | # Script URL
18 | URL="http://www.sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.0.4.1/phpMyAdmin-4.0.4.1-english.tar.gz/download"
19 |
20 | ###############
21 | ## Functions ##
22 | ###############
23 |
24 | # Random String Generator
25 | function rand() {
26 | [ "$2" = "0" ] && CHAR="[:alnum:]" || CHAR="[:graph:]"
27 | cat /dev/urandom | tr -cd "$CHAR" | head -c ${1:-48}
28 | echo
29 | }
30 |
31 | ############
32 | ## Script ##
33 | ############
34 |
35 | # Change File Settings
36 | shopt -s dotglob
37 |
38 | # Change Directory
39 | cd /home/$USER/http/hosts/$HOST
40 |
41 | # Check If Directory Variable Empty
42 | if [[ $DIRECTORY != "" ]]; then
43 | # Make Script Directory
44 | mkdir $DIRECTORY
45 |
46 | # Change Directory
47 | cd $DIRECTORY
48 | fi
49 |
50 | # Download Script
51 | wget -O phpmyadmin.tar.gz "$URL"
52 |
53 | # Extract Script
54 | tar xfvz phpmyadmin.tar.gz
55 |
56 | # Move Script
57 | mv phpMyAdmin-*/* .
58 |
59 | # Update Config
60 | cat > config.inc.php <
76 | END
77 |
78 | # Clean Useless Files
79 | rm -rf ChangeLog config.sample.inc.php examples LICENSE phpMyAdmin-* phpmyadmin.tar.gz README README.VENDOR RELEASE-DATE-* setup
80 |
81 | # Update Owner
82 | chown -R $USER:$USER .
83 |
84 | # Update Permissions
85 | chmod -R o= .
86 |
--------------------------------------------------------------------------------
/external/modules/configure-database-mysql/config.ini:
--------------------------------------------------------------------------------
1 | ; HTTP Configure: MySQL Database Server
2 | ; Change options relating to the configuration of the system MySQL server.
3 | [http_configure_mysql]
4 | ; Minimal Memory Usage
5 | ; Installs a configuration file that lowers the memory used by MySQL on startup, recommended on servers with less than 256 MB of RAM. To enable set value to 1, to disable set to 0.
6 | minimal_memory=1
7 | ; Disable InnoDB
8 | ; Installs a configuration file that disables the InnoDB database engine, removes InnoDB database files and sets MyISAM as default. Saves a lot of memory but can occasionally be slower based on what is being run. Recommended on servers will low RAM. To enable set value to 1, to disable set to 0.
9 | disable_innodb=1
10 |
--------------------------------------------------------------------------------
/external/modules/configure-database-mysql/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # HTTP Configure: MySQL Database Server
3 |
4 | # Check Package
5 | check_package_message "" "mysql-server" "install-database-mysql"
6 |
7 | # Configure MySQL For Minimal Memory Usage
8 | if question --default yes "Do you want to configure MySQL for minimal memory usage? (Y/n)" || [ $(read_var_module minimal_memory) = 1 ]; then
9 | subheader "Adding Configuration..."
10 | cp -r $MODULEPATH/$MODULE/mysql/conf.d/minimal.cnf /etc/mysql/conf.d/
11 | # Configure MySQL For Normal Memory Usage
12 | else
13 | subheader "Removing Configuration..."
14 | rm /etc/mysql/conf.d/minimal.cnf &> /dev/null
15 | fi
16 |
17 | # Disable InnoDB Database Engine
18 | if question --default yes "Do you want to disable the InnoDB database engine and remove InnoDB files (saves a lot of memory!)? (Y/n)" || [ $(read_var_module disable_innodb) = 1 ]; then
19 | subheader "Disabling InnoDB..."
20 | cp -r $MODULEPATH/$MODULE/mysql/conf.d/disable_innodb.cnf /etc/mysql/conf.d/
21 | subheader "Removing InnoDB Files..."
22 | rm -f /var/lib/mysql/ib* &> /dev/null
23 | # Enable InnoDB Database Engine
24 | else
25 | subheader "Enabling InnoDB..."
26 | rm /etc/mysql/conf.d/disable_innodb.cnf &> /dev/null
27 | fi
28 |
29 | # Restart Daemon
30 | subheader "Restarting Daemon..."
31 | if [ $DISTRIBUTION = "centos" ]; then
32 | daemon_manage mysqld restart
33 | else
34 | daemon_manage mysql restart
35 | fi
36 |
--------------------------------------------------------------------------------
/external/modules/configure-database-mysql/mysql/conf.d/disable_innodb.cnf:
--------------------------------------------------------------------------------
1 | [mysqld]
2 | default-storage-engine = myisam
3 | innodb = off
4 |
--------------------------------------------------------------------------------
/external/modules/configure-database-mysql/mysql/conf.d/minimal.cnf:
--------------------------------------------------------------------------------
1 | [mysqld]
2 | key_buffer_size = 8M
3 | max_allowed_packet = 1M
4 | max_connections = 20
5 | max_heap_table_size = 4M
6 | net_buffer_length = 2K
7 | query_cache_limit = 256K
8 | query_cache_size = 4M
9 | read_buffer_size = 256K
10 | read_rnd_buffer_size = 256K
11 | sort_buffer_size = 64K
12 | table_open_cache = 256
13 | thread_stack = 128K
14 |
--------------------------------------------------------------------------------
/external/modules/configure-database-postgresql/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/external/modules/configure-database-postgresql/config.ini
--------------------------------------------------------------------------------
/external/modules/configure-database-postgresql/init.sh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/external/modules/configure-database-postgresql/init.sh
--------------------------------------------------------------------------------
/external/modules/manage-add-host/config.ini:
--------------------------------------------------------------------------------
1 | ; Manage: Add Virtual Host
2 | [manage_add_host]
3 | ; Usernames (As Comma Separated List)
4 | user="main"
5 | ; Virtual Hosts (As Comma Separated List)
6 | host="test.example.com"
7 | ; Default Host? (As Comma Separated List, There Can Only Be One!, Accepted Values: 0 1)
8 | default="1"
9 | ; Enable PHP? (As Comma Separated List, Accepted Values: 0 1)
10 | php="1"
11 | ; Enable SSL? (As Comma Separated List, Accepted Values: 0 1)
12 | ssl="1"
13 |
--------------------------------------------------------------------------------
/external/modules/manage-add-host/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Manage: Add Virtual Host
3 |
4 | # Manage Common Functions
5 | manage-common
6 |
7 | # Manage HTTP Common Functions
8 | http-common
9 |
10 | # Attended Mode
11 | if [ $UNATTENDED = 0 ]; then
12 | # User Check Loop
13 | manage-http-check-user-loop
14 |
15 | # Host Check Loop
16 | manage-http-check-host-loop
17 |
18 | # Check Host
19 | manage-http-check-host
20 |
21 | # Check Host Existence
22 | manage-http-check-host-existence
23 |
24 | # Create Directories
25 | manage-http-create-directories
26 |
27 | # Generate Configuration
28 | manage-http-generate-configuration
29 |
30 | # Check Package
31 | if check_package "php5-fpm"; then
32 | # PHP Question
33 | if question --default yes "Do you want to enable PHP for this virtual host? (Y/n)"; then
34 | manage-http-enable-php 1
35 | else
36 | manage-http-enable-php 0
37 | fi
38 | else
39 | manage-http-enable-php 0
40 | fi
41 |
42 | # SSL Question
43 | if question --default yes "Do you want to enable SSL for this virtual host? (Y/n)"; then
44 | manage-http-enable-ssl 1
45 | else
46 | manage-http-enable-ssl 0
47 | fi
48 |
49 | # Default Question
50 | if question --default no "Do you want to set this virtual host as the default host? (y/N)"; then
51 | manage-http-default-host
52 | fi
53 | # Unattended Mode
54 | else
55 | # Define Arrays
56 | USERLIST=$(read_variable_module user),
57 | HOSTLIST=$(read_variable_module host),
58 | DEFAULTLIST=$(read_variable_module default),
59 | PHPLIST=$(read_variable_module php),
60 | SSLLIST=$(read_variable_module ssl),
61 |
62 | # Loop Through Users
63 | while echo $USERLIST | grep -q \,; do
64 | # Define Current
65 | USER=${USERLIST%%\,*}
66 | HOST=${HOSTLIST%%\,*}
67 | DEFAULT=${DEFAULTLIST%%\,*}
68 | PHP=${PHPLIST%%\,*}
69 | SSL=${SSLLIST%%\,*}
70 |
71 | # Remove Current User From List
72 | USERLIST=${USERLIST#*\,}
73 | HOSTLIST=${HOSTLIST#*\,}
74 | DEFAULTLIST=${DEFAULTLIST#*\,}
75 | PHPLIST=${PHPLIST#*\,}
76 | SSLLIST=${SSLLIST#*\,}
77 |
78 | # Check If Array Empty
79 | manage-check-array
80 |
81 | # Check User
82 | manage-check-user
83 |
84 | # Check Host
85 | manage-http-check-host
86 |
87 | # Create Directories
88 | manage-http-create-directories
89 |
90 | # Generate Configuration
91 | manage-http-generate-configuration
92 |
93 | # Default Check
94 | if [ $DEFAULT = 1 ]; then
95 | manage-http-default-host
96 | fi
97 |
98 | # Check Package
99 | if check_package "php5-fpm"; then
100 | # PHP Check
101 | if [ $PHP = 1 ]; then
102 | manage-http-enable-php 1
103 | else
104 | manage-http-enable-php 0
105 | fi
106 | else
107 | manage-http-enable-php 0
108 | fi
109 |
110 | # SSL Check
111 | if [ $SSL = 1 ]; then
112 | manage-http-enable-ssl 1
113 | else
114 | manage-http-enable-ssl 0
115 | fi
116 | done
117 | fi
118 |
119 | # Reset Host WWW Variable
120 | HOST_WWW=0
121 |
122 | # Reload Daemons
123 | manage-http-reload-daemons
124 |
--------------------------------------------------------------------------------
/external/modules/manage-http.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Common Functions For Module: Manage HTTP
3 |
4 | #subheader "Removing User Database..."
5 | #subheader "Removing User HTTP..."
6 | #rm -rf /etc/nginx/php.d/$1.conf
7 | #rm -rf /etc/nginx/sites-*/$1-*.conf
8 | #rm -rf /etc/php5/fpm/pool.d/$1.conf
9 |
10 | # Module Functions
11 | manage-http() {
12 | #################
13 | ## Check Loops ##
14 | #################
15 |
16 | # Host Check Loop
17 | manage-http-check-host-loop() {
18 | while true; do
19 | # Take Host Input
20 | read -p "Please enter the virtual host (e.g. www.example.com): " HOST
21 | # Check If User Directory Exists
22 | if [[ $HOST = *.* ]]; then
23 | break
24 | else
25 | echo "Please enter a valid virtual host."
26 | fi
27 | done
28 | }
29 |
30 | # User Check Loop
31 | manage-http-check-user-loop() {
32 | while true; do
33 | # Take User Input
34 | read -p "Please enter a user name: " USER
35 |
36 | # Check If User Directory Exists
37 | if [ -d /home/$USER ]; then
38 | if [ ! -d /home/$USER/http ]; then
39 | warning "User valid but no HTTP directory was found, run the manage user module to fix and then retry."
40 | continue
41 | fi
42 | break
43 | else
44 | echo "Please enter a valid username."
45 | fi
46 | done
47 | }
48 |
49 | #####################
50 | ## Check Functions ##
51 | #####################
52 |
53 | # Check Directory
54 | manage-http-check-directory() {
55 | if [ ! -f /etc/nginx/sites-available/$USER-$HOST_DIR.conf ]; then
56 | warning "The virtual host configuration file does not exist (/etc/nginx/sites-available/$USER-$HOST_DIR.conf), run this module again and re-enter the information!"
57 | continue
58 | fi
59 | }
60 |
61 | # Check Host
62 | manage-http-check-host() {
63 | subheader "Checking Host..."
64 | if [[ $HOST = www.*.* ]]; then
65 | HOST_DIR=$(echo $HOST | sed "s/....\(.*\)/\1/")
66 | HOST_WWW=1
67 | else
68 | HOST_DIR=$HOST
69 | HOST_WWW=0
70 | fi
71 | }
72 |
73 | # Check Host Existence
74 | manage-http-check-host-existence() {
75 | if [ -f /etc/nginx/sites-available/$USER-$HOST_DIR.conf ]; then
76 | warning "This virtual host already exists, please use the manage-manage-host module to edit it!"
77 | continue
78 | fi
79 | }
80 |
81 | #####################
82 | ## Setup Functions ##
83 | #####################
84 |
85 | # Create Directories
86 | manage-http-create-directories() {
87 | subheader "Creating Host Directory"
88 | mkdir /home/$USER/http/hosts/$HOST_DIR &> /dev/null
89 | chown -R $USER:$USER /home/$USER/http/hosts/$HOST_DIR
90 | find /home/$USER/http/hosts/$HOST_DIR -type d -exec chmod 770 {} \;
91 | }
92 |
93 | # Generate Configuration
94 | manage-http-generate-configuration() {
95 | # Create Host Configuration
96 | subheader "Creating Host Configuration..."
97 | touch /etc/nginx/sites-available/$USER-$HOST_DIR.conf
98 |
99 | # Update Host Configuration (WWW)
100 | if [ $HOST_WWW = 1 ]; then
101 | subheader "Updating Host Configuration (WWW)..."
102 | cat >> /etc/nginx/sites-available/$USER-$HOST_DIR.conf <> /etc/nginx/sites-available/$USER-$HOST_DIR.conf
111 | fi
112 |
113 | # Update Host Configuration
114 | subheader "Updating Host Configuration..."
115 | cat >> /etc/nginx/sites-available/$USER-$HOST_DIR.conf <> /etc/nginx/sites-available/$USER-$HOST_DIR-ssl.conf <> /etc/nginx/sites-available/$USER-$HOST_DIR-ssl.conf
149 | fi
150 |
151 | # Update Host Configuration (SSL)
152 | subheader "Updating Host Configuration (SSL)..."
153 | cat >> /etc/nginx/sites-available/$USER-$HOST_DIR-ssl.conf < /etc/nginx/php.d/$USER.conf < /etc/php5/fpm/pool.d/$USER.conf < /etc/nginx/sites-available/default.conf < /etc/nginx/sites-available/default-ssl.conf < /dev/null
253 | # Enable SSH Variable
254 | SSL=1
255 | else
256 | subheader "Disabling SSL..."
257 | mv /etc/nginx/sites-available/$USER-$HOST_DIR-ssl.conf /etc/nginx/sites-available/$USER-$HOST_DIR-ssl.disabled &> /dev/null
258 | # Disable SSH Variable
259 | SSL=0
260 | fi
261 | }
262 |
263 | #######################
264 | ## Removal Functions ##
265 | #######################
266 |
267 | # Remove Host
268 | manage-http-remove-host() {
269 | subheader "Removing Host..."
270 | rm /home/$USER/http/logs/$HOST_DIR.log
271 | rm /etc/nginx/sites-available/$USER-$HOST_DIR{.conf,-ssl*}
272 | if ! ls /etc/nginx/sites-available/$USER-*.conf &> /dev/null; then
273 | rm /etc/nginx/php.d/$USER.conf
274 | rm /etc/php5/fpm/pool.d/$USER.conf
275 | fi
276 | }
277 |
278 | # Remove Host Files
279 | manage-http-remove-host-files() {
280 | subheader "Removing Host Files..."
281 | rm -rf /home/$USER/http/hosts/$HOST_DIR/
282 | }
283 |
284 | #####################
285 | ## Final Functions ##
286 | #####################
287 |
288 | # Reload Daemons
289 | manage-http-reload-daemons() {
290 | # Check Package
291 | if check_package "php5-fpm"; then
292 | subheader "Restarting Daemon (PHP-FPM)..."
293 | daemon_manage php5-fpm restart
294 | fi
295 |
296 | # Check Package
297 | if check_package "nginx"; then
298 | subheader "Restarting Daemon (nginx)..."
299 | daemon_manage nginx restart
300 | fi
301 | }
302 | }
303 |
--------------------------------------------------------------------------------
/external/modules/manage-manage-host/config.ini:
--------------------------------------------------------------------------------
1 | [manage_manage_host]
2 | ; Usernames (As Comma Separated List)
3 | user="main"
4 | ; Virtual Hosts (As Comma Separated List)
5 | host="test.example.com"
6 | ; Default Host? (As Comma Separated List, There Can Only Be One!, Accepted Values: 0 1)
7 | default="1"
8 | ; Enable PHP? (As Comma Separated List, Accepted Values: 0 1)
9 | php="1"
10 | ; Enable SSL? (As Comma Separated List, Accepted Values: 0 1)
11 | ssl="1"
12 |
--------------------------------------------------------------------------------
/external/modules/manage-manage-host/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Manage: Manage Virtual Host
3 |
4 | # Manage Common Functions
5 | manage-common
6 |
7 | # Manage HTTP Common Functions
8 | http-common
9 |
10 | # Attended Mode
11 | if [ $UNATTENDED = 0 ]; then
12 | # User Check Loop
13 | manage-http-check-user-loop
14 |
15 | # Host Check Loop
16 | manage-http-check-host-loop
17 |
18 | # Check Host
19 | manage-http-check-host
20 |
21 | # Check Directory
22 | manage-http-check-directory
23 |
24 | # Check Package
25 | if check_package "php5-fpm"; then
26 | # PHP Question
27 | if question --default yes "Do you want to enable PHP for this virtual host? (Y/n)"; then
28 | manage-http-enable-php 1
29 | else
30 | manage-http-enable-php 0
31 | fi
32 | else
33 | manage-http-enable-php 0
34 | fi
35 |
36 | # SSL Question
37 | if question --default yes "Do you want to enable SSL for this virtual host? (Y/n)"; then
38 | manage-http-enable-ssl 1
39 | else
40 | manage-http-enable-ssl 0
41 | fi
42 |
43 | # Default Question
44 | if question --default no "Do you want to set this virtual host as the default host? (y/N)"; then
45 | manage-http-default-host
46 | fi
47 | # Unattended Mode
48 | else
49 | # Define Arrays
50 | USERLIST=$(read_variable_module user),
51 | HOSTLIST=$(read_variable_module host),
52 | DEFAULTLIST=$(read_variable_module default),
53 | PHPLIST=$(read_variable_module php),
54 | SSLLIST=$(read_variable_module ssl),
55 |
56 | # Loop Through Users
57 | while echo $USERLIST | grep -q \,; do
58 | # Define Current
59 | USER=${USERLIST%%\,*}
60 | HOST=${HOSTLIST%%\,*}
61 | DEFAULT=${DEFAULTLIST%%\,*}
62 | PHP=${PHPLIST%%\,*}
63 | SSL=${SSLLIST%%\,*}
64 |
65 | # Remove Current User From List
66 | USERLIST=${USERLIST#*\,}
67 | HOSTLIST=${HOSTLIST#*\,}
68 | DEFAULTLIST=${DEFAULTLIST#*\,}
69 | PHPLIST=${PHPLIST#*\,}
70 | SSLLIST=${SSLLIST#*\,}
71 |
72 | # Check If Array Empty
73 | manage-check-array
74 |
75 | # Check User
76 | manage-check-user
77 |
78 | # Check Host
79 | manage-http-check-host
80 |
81 | # Check Directory
82 | manage-http-check-directory
83 |
84 | # Default Check
85 | if [ $DEFAULT = 1 ]; then
86 | manage-http-default-host
87 | fi
88 |
89 | # Check Package
90 | if check_package "php5-fpm"; then
91 | # PHP Check
92 | if [ $PHP = 1 ]; then
93 | manage-http-enable-php 1
94 | else
95 | manage-http-enable-php 0
96 | fi
97 | else
98 | manage-http-enable-php 0
99 | fi
100 |
101 | # SSL Check
102 | if [ $SSL = 1 ]; then
103 | manage-http-enable-ssl 1
104 | else
105 | manage-http-enable-ssl 0
106 | fi
107 | done
108 | fi
109 |
110 | # Reset Host WWW Variable
111 | HOST_WWW=0
112 |
113 | # Reload Daemons
114 | manage-http-reload-daemons
115 |
--------------------------------------------------------------------------------
/external/modules/manage-remove-host/config.ini:
--------------------------------------------------------------------------------
1 | [manage_remove_host]
2 | ; Usernames (As Comma Separated List)
3 | user="main"
4 | ; Virtual Hosts (As Comma Separated List)
5 | host="test.example.com"
6 | ; Remove Directory?
7 | rm="1"
8 |
--------------------------------------------------------------------------------
/external/modules/manage-remove-host/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Manage: Remove Virtual Host
3 |
4 | # Manage Common Functions
5 | manage-common
6 |
7 | # Manage HTTP Common Functions
8 | http-common
9 |
10 | # Attended Mode
11 | if [ $UNATTENDED = 0 ]; then
12 | # User Check Loop
13 | manage-http-check-user-loop
14 |
15 | # Host Check Loop
16 | manage-http-check-host-loop
17 |
18 | # Check Host
19 | manage-http-check-host
20 |
21 | # Check Directory
22 | manage-http-check-directory
23 |
24 | # Confirmation Question
25 | if question --default yes "Are you sure you want to remove this virtual host? (Y/n)"; then
26 | # Remove Host
27 | manage-http-remove-host
28 | else
29 | # Continue Loop
30 | continue
31 | fi
32 |
33 | # Confirmation Question
34 | if question --default yes "Do you want to delete the virtual host directory? (Y/n)"; then
35 | # Remove Host Files
36 | manage-http-remove-host-files
37 | fi
38 | # Unattended Mode
39 | else
40 | # Define Arrays
41 | USERLIST=$(read_variable_module user),
42 | HOSTLIST=$(read_variable_module host),
43 | RMLIST=$(read_variable_module rm),
44 |
45 | # Loop Through Users
46 | while echo $USERLIST | grep -q \,; do
47 | # Define Current
48 | USER=${USERLIST%%\,*}
49 | HOST=${HOSTLIST%%\,*}
50 | RM=${RMLIST%%\,*}
51 |
52 | # Remove Current User From List
53 | USERLIST=${USERLIST#*\,}
54 | HOSTLIST=${HOSTLIST#*\,}
55 | RMLIST=${RMLIST#*\,}
56 |
57 | # Check If Array Empty
58 | manage-check-array
59 |
60 | # Check User
61 | manage-check-user
62 |
63 | # Check Host
64 | manage-http-check-host
65 |
66 | # Check Directory
67 | manage-http-check-directory
68 |
69 | # Remove Host
70 | manage-http-remove-host
71 |
72 | # Remove Host Files
73 | if [ $RM = 1 ]; then
74 | manage-http-remove-host-files
75 | fi
76 | done
77 | fi
78 |
79 | # Reset Host WWW Variable
80 | HOST_WWW=0
81 |
82 | # Check Package
83 | if check_package "php5-fpm"; then
84 | subheader "Restarting Daemon (PHP-FPM)..."
85 | daemon_manage php5-fpm restart
86 | fi
87 |
88 | # Check Package
89 | if check_package "nginx"; then
90 | subheader "Restarting Daemon (nginx)..."
91 | daemon_manage nginx restart
92 | fi
93 |
--------------------------------------------------------------------------------
/libraries/10.distribution.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Distribution Detection
3 |
4 | # Set Defaults
5 | DISTRIBUTION=none
6 | VERSION=none
7 |
8 | # Debian 6 Detection (Issue File)
9 | if [ -f /etc/issue ]; then
10 | # Search Issue File
11 | if grep -iq "Debian GNU/Linux 6.0" /etc/issue; then
12 | # Set Distribution
13 | DISTRIBUTION=debian
14 |
15 | # Set Version
16 | VERSION=6
17 | fi
18 | fi
19 |
20 | # Debian 6 Detection (LSB Release)
21 | if command -v lsb_release &> /dev/null; then
22 | # Check LSB Release
23 | if [ $(lsb_release -is) = "Debian" ] && [[ $(lsb_release -rs) == 6.* ]]; then
24 | # Set Distribution
25 | DISTRIBUTION=debian
26 |
27 | # Set Version
28 | VERSION=6
29 | fi
30 | fi
31 |
32 | # Debian 7 Detection (Issue File)
33 | if [ -f /etc/issue ]; then
34 | # Search Issue File
35 | if grep -iq "Debian GNU/Linux 7.0" /etc/issue; then
36 | # Set Distribution
37 | DISTRIBUTION=debian
38 |
39 | # Set Version
40 | VERSION=7
41 | fi
42 | fi
43 |
44 | # Debian 7 Detection (LSB Release)
45 | if command -v lsb_release &> /dev/null; then
46 | # Check LSB Release
47 | if [ $(lsb_release -is) = "Debian" ] && [[ $(lsb_release -rs) == 7.* ]]; then
48 | # Set Distribution
49 | DISTRIBUTION=debian
50 |
51 | # Set Version
52 | VERSION=7
53 | fi
54 | fi
55 |
56 | # Ubuntu 12.04 Detection (Issue File)
57 | if [ -f /etc/issue ]; then
58 | # Search Issue File
59 | if grep -iq "Ubuntu 12.04" /etc/issue; then
60 | # Set Distribution
61 | DISTRIBUTION=ubuntu
62 |
63 | # Set Version
64 | VERSION=1204
65 | fi
66 | fi
67 |
68 | # Ubuntu 12.04 Detection (LSB Release)
69 | if command -v lsb_release &> /dev/null; then
70 | # Check LSB Release
71 | if [ $(lsb_release -is) = "Ubuntu" ] && [ $(lsb_release -rs) = "12.04" ]; then
72 | # Set Distribution
73 | DISTRIBUTION=ubuntu
74 |
75 | # Set Version
76 | VERSION=1204
77 | fi
78 | fi
79 |
--------------------------------------------------------------------------------
/libraries/10.platform.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Architecture & Platform Detection
3 |
4 | # Set Defaults
5 | ARCHITECTURE=none
6 | PLATFORM=hardware
7 |
8 | # Architecture Detection: 32 Bit
9 | if [ $(uname -m) = "i386" ] || [ $(uname -m) = "i486" ] || [ $(uname -m) = "i586" ] || [ $(uname -m) = "i686" ]; then
10 | # Set Architecture
11 | ARCHITECTURE=x32
12 | fi
13 |
14 | # Architecture Detection: 64 Bit
15 | if [ $(uname -m) = "x86_64" ]; then
16 | # Set Architecture
17 | ARCHITECTURE=x64
18 | fi
19 |
20 | # Platform Detection: OpenVZ
21 | if [ -f /proc/user_beancounters ] || [ -d /proc/bc ]; then
22 | # Set Platform
23 | PLATFORM=openvz
24 | fi
25 |
26 | # Platform Detection: vServer
27 | if uname -a | grep -q "vserver"; then
28 | # Set Platform
29 | PLATFORM=vserver
30 | fi
31 |
--------------------------------------------------------------------------------
/libraries/20.message.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Headers & Messages
3 |
4 | # Print Header
5 | header() {
6 | echo -e "\e[1;34m>> \e[1;37m$* \e[1;34m<<\e[0m"
7 | }
8 |
9 | # Print Subheader
10 | subheader() {
11 | echo -e "\e[1;32m>> \e[1;37m$*\e[0m"
12 | }
13 |
14 | # Print Error Message
15 | error() {
16 | echo -e "\e[1;31m$*\e[0m"
17 | }
18 |
19 | # Print Warning Message
20 | warning() {
21 | echo -e "\e[1;33m$*\e[0m"
22 | }
23 |
--------------------------------------------------------------------------------
/libraries/20.test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Compatibility Tests
3 |
4 | # Distribution Check
5 | if [ $DISTRIBUTION = "none" ]; then
6 | # Error Message
7 | error "Your distribution is unsupported! To improve distribution detection install the lsb-release package."
8 |
9 | # Exit
10 | exit
11 | fi
12 |
13 | # Version Check
14 | if [ $VERSION = "none" ]; then
15 | # Error Message
16 | error "Your distribution version is unsupported! To improve version detection install the lsb-release package."
17 |
18 | # Exit
19 | exit
20 | fi
21 |
22 | # Architecture Check
23 | if [ $ARCHITECTURE = "none" ]; then
24 | # Error Message
25 | error "Your architecture is unsupported! Please ensure you are using a compatible system."
26 |
27 | # Exit
28 | exit
29 | fi
30 |
31 | # Platform Check
32 | if [ $PLATFORM = "none" ]; then
33 | # Error Message
34 | error "Your platform is unsupported! Please ensure you are using a compatible system."
35 |
36 | # Exit
37 | exit
38 | fi
39 |
--------------------------------------------------------------------------------
/libraries/30.configuration.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Configuration Parsing
3 |
4 | # INI Variable Tester
5 | read_variable() {
6 | # Check If Variable Exists
7 | if [[ $(eval "echo \${INI__$1}") = "" ]]; then
8 | # Echo False
9 | echo 0
10 | else
11 | # Echo Variable
12 | eval "echo \${INI__$1}"
13 | fi
14 | }
15 |
16 | # INI Variable Tester (Module)
17 | read_variable_module() {
18 | # If Unattended Mode, Check Variables
19 | if [ $UNATTENDED = 1 ]; then
20 | # Check If Variable Exists
21 | if [[ $(eval "echo \${INI__$(safe_string $MODULE)__$1}") = "" ]]; then
22 | # Echo False
23 | echo 0
24 | else
25 | # Echo Variable
26 | eval "echo \${INI__$(safe_string $MODULE)__$1}"
27 | fi
28 | else
29 | # Return False
30 | echo 0
31 | fi
32 | }
33 |
34 | # INI Variable Tester (Module Variable)
35 | read_variable_module_variable() {
36 | # Check If Variable Exists
37 | if [[ $(eval "echo \${INI__$(safe_string $MODULE)__$1}") = "" ]]; then
38 | # Echo False
39 | echo 0
40 | else
41 | # Echo Variable
42 | eval "echo \${INI__$(safe_string $MODULE)__$1}"
43 | fi
44 | }
45 |
46 | # Remove Invalid Characters From Section Names
47 | safe_string() {
48 | # Replace Dash With Underscore
49 | echo "$1" | tr - _
50 | }
51 |
--------------------------------------------------------------------------------
/libraries/30.module.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Module Information
3 |
4 | # Print Module Description
5 | describe() {
6 | # Print Description
7 | echo $(sed -n "2p" $1 | cut -c3-)
8 | }
9 |
10 | # Print All Module Information
11 | list() {
12 | # Find Directory Name
13 | base=$(dirname $1)
14 |
15 | # Find File Name
16 | module=$(basename $base)
17 |
18 | # Print Module Name
19 | echo -en "\e[1;32m$module:\e[0m "
20 |
21 | # Print Description
22 | echo $(describe $1)
23 | }
24 |
--------------------------------------------------------------------------------
/libraries/40.check.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Package & Repository Checks
3 |
4 | # Combined Package Check Function
5 | check_package_message() {
6 | # Distribution Test
7 | if [[ $1 == "" ]] || [[ $1 == $DISTRIBUTION ]] || [[ $1 == $DISTRIBUTION-$VERSION ]]; then
8 | # Check Package
9 | if ! check_package $2; then
10 | # Print Warning
11 | warning "This module requires the $2 package to be installed, please install it and try again!"
12 |
13 | # Suggested Module Text Test
14 | if [ $3 != "" ]; then
15 | # Print Suggested Module Information
16 | warning "The $2 package can be installed using the $3 module."
17 | fi
18 |
19 | # Continue Loop
20 | continue
21 | fi
22 | fi
23 | }
24 |
25 | # Combined Repository Check Function
26 | check_repository_message() {
27 | # Distribution Test
28 | if [[ $1 == "" ]] || [[ $1 == $DISTRIBUTION ]] || [[ $1 == $DISTRIBUTION-$VERSION ]]; then
29 | # Check Package
30 | if ! check_repository $2; then
31 | # Print Warning
32 | warning "This module requires the $3 repository to be installed, please install it and try again!"
33 |
34 | # Print Suggested Module Information
35 | warning "The $3 repository can be installed using the install-extra-repositories module."
36 |
37 | # Continue Loop
38 | continue
39 | fi
40 | fi
41 | }
42 |
--------------------------------------------------------------------------------
/libraries/40.package.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Package List Update Management
3 |
4 | # Set Package List Update Variable
5 | PACKAGE_LIST_UPDATE=0
6 |
7 | # Package List Update Question
8 | package_update_question() {
9 | # Check If Package List Update Has Been Run Previously
10 | if [ $PACKAGE_LIST_UPDATE = 0 ]; then
11 | # Ask Question
12 | if question --default yes "Do you want to update the package list? (Y/n)" || [[ $UNATTENDED = 1 && $(read_variable minstall__package_update) = 1 ]]; then
13 | # Update Package Lists
14 | package_update
15 | fi
16 |
17 | # Set Package List Update Variable
18 | PACKAGE_LIST_UPDATE=1
19 | fi
20 | }
21 |
--------------------------------------------------------------------------------
/libraries/40.replace.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # String Replacement
3 |
4 | # Escape Input
5 | escape() {
6 | # Replace Slash With Escaped Slash
7 | echo "$1" | sed -e 's/\//\\\//g'
8 | }
9 |
10 | # Replace String
11 | string_replace() {
12 | # Search & Replace String
13 | echo "$1" | sed "s/$(escape $2)/$(escape $3)/"
14 | }
15 |
16 | # Replace String (No Escape)
17 | string_replace_ne() {
18 | # Search & Replace String
19 | echo "$1" | sed "s/$2/$3/"
20 | }
21 |
22 | # Replace String In File
23 | string_replace_file() {
24 | # Search & Replace File
25 | sed -i "s/$(escape $2)/$(escape $3)/g" $1
26 | }
27 |
28 | # Replace String In File (No Escape)
29 | string_replace_file_ne() {
30 | # Search & Replace File
31 | sed -i "s/$2/$3/g" $1
32 | }
33 |
34 | # Replace String In Output
35 | string_replace_output() {
36 | # Search & Replace Output
37 | sed "s/$(escape $3)/$(escape $4)/g" $1 > $2
38 | }
39 |
40 | # Replace String In Output (No Escape)
41 | string_replace_output_ne() {
42 | # Search & Replace Output
43 | sed "s/$3/$4/g" $1 > $2
44 | }
45 |
--------------------------------------------------------------------------------
/libraries/default/config.ini:
--------------------------------------------------------------------------------
1 | ; Minstall Configuration File
2 | ; ===========================
3 | ; Note: All settings must stay in the format they are in by default, script is not guaranteed to work otherwise!
4 | ; Modules without options are not included.
5 |
6 | ; Minstall Options
7 | ; General options for Minstall, this section must exist as the script will fail if it is removed.
8 | [minstall]
9 | ; Debug Mode
10 | ; This flag pauses the script after each module has been run and enables easier viewing of output. To enable set value to 1, to disable set to 0.
11 | debug=0
12 | ; Automatic Package List Update
13 | ; This flag will enable updating of the system package list prior to the first module running. To enable set value to 1, to disable set to 0.
14 | package_update=1
15 |
--------------------------------------------------------------------------------
/libraries/default/launcher.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Launch Minstall
3 | cd /opt/minstall
4 | bash minstall.sh "$@"
5 |
--------------------------------------------------------------------------------
/libraries/external/question.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For User Questions
3 |
4 | # Ask Question
5 | function question() {
6 | if [ $UNATTENDED = 0 ]; then
7 | local ans
8 | local ok=0
9 | local timeout=0
10 | local default
11 | local t
12 | while [[ "$1" ]]; do
13 | case "$1" in
14 | --default)
15 | shift
16 | default=$1
17 | if [[ ! "$default" ]]; then
18 | error "Missing default value."
19 | fi
20 | t=$(tr '[:upper:]' '[:lower:]' <<< $default)
21 | if [[ "$t" != 'y' && "$t" != 'yes' && "$t" != 'n' && "$t" != 'no' ]]; then
22 | error "Illegal default answer: $default"
23 | fi
24 | default=$t
25 | shift
26 | ;;
27 | --timeout)
28 | shift
29 | timeout=$1
30 | if [[ ! "$timeout" ]]; then
31 | error "Missing timeout value."
32 | fi
33 | if [[ ! "$timeout" =~ ^[0-9][0-9]*$ ]]; then
34 | error "Illegal timeout value: $timeout"
35 | fi
36 | shift
37 | ;;
38 | -*)
39 | error "Unrecognized option: $1"
40 | ;;
41 | *)
42 | break
43 | ;;
44 | esac
45 | done
46 | if [[ $timeout -ne 0 && ! "$default" ]]; then
47 | error "Non-Zero timeout requires a default answer."
48 | fi
49 | if [[ ! "$*" ]]; then
50 | error "Missing Question"
51 | fi
52 | while [[ $ok -eq 0 ]]; do
53 | if [[ $timeout -ne 0 ]]; then
54 | if ! read -t $timeout -p "$* " ans; then
55 | ans=$default
56 | else
57 | timeout=0
58 | if [[ ! "$ans" ]]; then
59 | ans=$default;
60 | fi
61 | fi
62 | else
63 | read -p "$* " ans
64 | if [[ ! "$ans" ]]; then
65 | ans=$default
66 | else
67 | ans=$(tr '[:upper:]' '[:lower:]' <<<$ans)
68 | fi
69 | fi
70 | if [[ "$ans" == 'y' || "$ans" == 'yes' || "$ans" == 'n' || "$ans" == 'no' ]]; then
71 | ok=1
72 | fi
73 | if [[ $ok -eq 0 ]]; then
74 | warning "Valid answers are yes/no or y/n."
75 | fi
76 | done
77 | [[ "$ans" = "y" || "$ans" == "yes" ]]
78 | else
79 | false
80 | fi
81 | }
82 |
83 | # Ask Question (Number)
84 | function question_number() {
85 | if [ $UNATTENDED = 0 ]; then
86 | while true; do
87 | read -p "$1 " nm
88 | if [[ "$nm" =~ ^[0-9]+$ ]]; then
89 | break
90 | else
91 | echo "Please enter a number."
92 | fi
93 | done
94 | echo $nm
95 | else
96 | false
97 | fi
98 | }
99 |
--------------------------------------------------------------------------------
/libraries/external/read_ini.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For INI Parsing
3 |
4 | # Read INI
5 | function read_ini() {
6 | function check_ini_file() {
7 | if [ ! -r "$INI_FILE" ]; then
8 | echo "read_ini: '${INI_FILE}' doesn't exist or not readable" >&2
9 | return 1
10 | fi
11 | }
12 |
13 | function check_prefix() {
14 | if ! [[ "${VARNAME_PREFIX}" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then
15 | echo "read_ini: invalid prefix '${VARNAME_PREFIX}'" >&2
16 | return 1
17 | fi
18 | }
19 |
20 | function cleanup_bash() {
21 | shopt -q -u ${SWITCH_SHOPT}
22 | unset -f check_prefix check_ini_file pollute_bash cleanup_bash
23 | }
24 |
25 | function pollute_bash() {
26 | if ! shopt -q extglob; then
27 | SWITCH_SHOPT="${SWITCH_SHOPT} extglob"
28 | fi
29 | if ! shopt -q nocasematch; then
30 | SWITCH_SHOPT="${SWITCH_SHOPT} nocasematch"
31 | fi
32 | shopt -q -s ${SWITCH_SHOPT}
33 | }
34 |
35 | local INI_FILE=""
36 | local INI_SECTION=""
37 | local BOOLEANS=1
38 | local VARNAME_PREFIX=INI
39 | local CLEAN_ENV=0
40 | while [ $# -gt 0 ]; do
41 | case $1 in
42 | --clean | -c )
43 | CLEAN_ENV=1
44 | ;;
45 | --booleans | -b )
46 | shift
47 | BOOLEANS=$1
48 | ;;
49 | --prefix | -p )
50 | shift
51 | VARNAME_PREFIX=$1
52 | ;;
53 | * )
54 | if [ -z "$INI_FILE" ]
55 | then
56 | INI_FILE=$1
57 | else
58 | if [ -z "$INI_SECTION" ]
59 | then
60 | INI_SECTION=$1
61 | fi
62 | fi
63 | ;;
64 | esac
65 | shift
66 | done
67 | if [ -z "$INI_FILE" ] && [ "${CLEAN_ENV}" = 0 ]; then
68 | echo -e "Usage: read_ini [-c] [-b 0| -b 1]] [-p PREFIX] FILE"\
69 | "[SECTION]\n or read_ini -c [-p PREFIX]" >&2
70 | cleanup_bash
71 | return 1
72 | fi
73 | if ! check_prefix; then
74 | cleanup_bash
75 | return 1
76 | fi
77 | local INI_ALL_VARNAME="${VARNAME_PREFIX}__ALL_VARS"
78 | if [ "${CLEAN_ENV}" = 1 ]; then
79 | eval unset "\$${INI_ALL_VARNAME}"
80 | fi
81 | unset ${INI_ALL_VARNAME}
82 | if [ -z "$INI_FILE" ]; then
83 | cleanup_bash
84 | return 0
85 | fi
86 | if ! check_ini_file; then
87 | cleanup_bash
88 | return 1
89 | fi
90 | if [ "$BOOLEANS" != "0" ]; then
91 | BOOLEANS=1
92 | fi
93 |
94 | local LINE_NUM=0
95 | local SECTION=""
96 | local IFS=$' \t\n'
97 | local IFS_OLD="${IFS}"
98 | local SWITCH_SHOPT=""
99 | pollute_bash
100 | while read -r line; do
101 | ((LINE_NUM++))
102 | if [ -z "$line" -o "${line:0:1}" = ";" -o "${line:0:1}" = "#" ]; then
103 | continue
104 | fi
105 | if [[ "${line}" =~ ^\[[a-zA-Z0-9_]{1,}\]$ ]]; then
106 | SECTION="${line#[}"
107 | SECTION="${SECTION%]}"
108 | continue
109 | fi
110 | if [ ! -z "$INI_SECTION" ]; then
111 | if [ "$SECTION" != "$INI_SECTION" ]; then
112 | continue
113 | fi
114 | fi
115 | if ! [[ "${line}" =~ ^[a-zA-Z0-9._]{1,}[[:space:]]*= ]]; then
116 | echo "Error: Invalid line:" >&2
117 | echo " ${LINE_NUM}: $line" >&2
118 | cleanup_bash
119 | return 1
120 | fi
121 | IFS="="
122 | read -r VAR VAL <<< "${line}"
123 | IFS="${IFS_OLD}"
124 | VAR="${VAR%%+([[:space:]])}"
125 | VAL="${VAL##+([[:space:]])}"
126 | VAR=$(echo $VAR)
127 | if [ -z "$SECTION" ]; then
128 | VARNAME=${VARNAME_PREFIX}__${VAR//./_}
129 | else
130 | VARNAME=${VARNAME_PREFIX}__${SECTION}__${VAR//./_}
131 | fi
132 | eval "${INI_ALL_VARNAME}=\"\$${INI_ALL_VARNAME} ${VARNAME}\""
133 | if [[ "${VAL}" =~ ^\".*\"$ ]]; then
134 | VAL="${VAL##\"}"
135 | VAL="${VAL%%\"}"
136 | elif [[ "${VAL}" =~ ^\'.*\'$ ]]; then
137 | VAL="${VAL##\'}"
138 | VAL="${VAL%%\'}"
139 | elif [ "$BOOLEANS" = 1 ]; then
140 | case "$VAL" in
141 | yes | true | on )
142 | VAL=1
143 | ;;
144 | no | false | off )
145 | VAL=0
146 | ;;
147 | esac
148 | fi
149 | VAL="${VAL//\\/\\\\}"
150 | VAL="\$'${VAL//\'/\'}'"
151 | eval "$VARNAME=$VAL"
152 | done < "${INI_FILE}"
153 | cleanup_bash
154 | }
155 |
--------------------------------------------------------------------------------
/libraries/module/common-clean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Common Functions For Module Category: Clean
3 |
4 | # Module Functions
5 | common-clean() {
6 | # Check Package
7 | if check_package "nginx"; then
8 | # Create PHP Directories
9 | mkdir -p /etc/php5/fpm/pool.d &> /dev/null
10 |
11 | # Copy Nginx Configuration
12 | cp -f $MODULEPATH/install-http-nginx/etc/nginx/* /etc/nginx/ &> /dev/null
13 | cp -f $MODULEPATH/install-http-nginx/etc/nginx/conf.d/* /etc/nginx/conf.d/ &> /dev/null
14 | mv -f /etc/nginx/mime.types /etc/nginx/nginx.d/mime.conf &> /dev/null
15 | fi
16 |
17 | # Remove PHP Default Pool
18 | rm /etc/php5/fpm/pool.d/www.conf &> /dev/null
19 | }
20 |
--------------------------------------------------------------------------------
/libraries/module/manage-user.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Common Functions For Module: Manage User
3 |
4 | # Module Functions
5 | manage-user() {
6 | #####################
7 | ## Check Functions ##
8 | #####################
9 |
10 | # Check If Array Empty
11 | manage-user-check-array() {
12 | if [ $1 = 0 ]; then
13 | # Print Message
14 | error "No users in user array. Aborting."
15 |
16 | # Exit Loop
17 | break
18 | fi
19 | }
20 |
21 | # Check If User Exists
22 | manage-user-check-user() {
23 | if [ ! -d /home/$1 ]; then
24 | # Print Message
25 | echo "Invalid user ($1)."
26 |
27 | # Continue Loop
28 | continue
29 | fi
30 | }
31 |
32 | ###########################
33 | ## Interactive Functions ##
34 | ###########################
35 |
36 | # Input Check
37 | manage-user-input-check() {
38 | # Check Loop
39 | while true; do
40 | # Take Input
41 | read -p "Please enter a user: " USER
42 |
43 | # Check Input
44 | if [ -d /home/$USER ]; then
45 | # Exit Loop
46 | break
47 | else
48 | # Print Error
49 | echo "Invalid user. Ensure the user exists on the system."
50 | fi
51 | done
52 | }
53 |
54 | # Input User
55 | manage-user-input-user() {
56 | # Check Loop
57 | while true; do
58 | # Take Input
59 | read -p "Please enter a user: " USER
60 |
61 | # Check Input
62 | if grep -q '^[-0-9a-zA-Z]*$' <<< $1 || [[ $1 == "default" || $1 == "system" || $1 == "www-data" ]]; then
63 | # Exit Loop
64 | break
65 | else
66 | # Print Error
67 | echo "Invalid user. Ensure the username contains only alphanumeric characters."
68 | fi
69 | done
70 | }
71 |
72 | ##########################
73 | ## Management Functions ##
74 | ##########################
75 |
76 | # Add User
77 | manage-user-manage-add() {
78 | subheader "Adding User..."
79 | useradd -m -s /bin/bash $1
80 | }
81 |
82 | # Remove User
83 | manage-user-manage-remove() {
84 | subheader "Removing User..."
85 | userdel -f -r $1
86 |
87 | subheader "Removing User Home..."
88 | rm -rf /home/$1
89 |
90 | subheader "Removing User Database..."
91 | #PLACEHOLDER#
92 |
93 | subheader "Removing User HTTP..."
94 | rm -rf /etc/nginx/php.d/$1.conf
95 | rm -rf /etc/nginx/sites-*/$1-*.conf
96 | rm -rf /etc/php5/fpm/pool.d/$1.conf
97 | }
98 |
99 | # Set Password
100 | manage-user-set-password() {
101 | subheader "Setting Password..."
102 | # Check Variable Set State
103 | if [[ -z "$2" ]]; then
104 | # Set Password
105 | passwd $1
106 | else
107 | # Set Password
108 | echo "$1:$2" | chpasswd
109 | fi
110 | }
111 |
112 | # Set Permissions
113 | manage-user-set-permissions() {
114 | subheader "Setting Permissions..."
115 | chmod -R o= /home/$1
116 | chown -R $1:$1 /home/$1
117 | }
118 |
119 | # Add User to Group
120 | manage-user-add-group() {
121 | subheader "Adding User to Group..."
122 | adduser $1 $2
123 | }
124 |
125 | # Remove User from Group
126 | manage-user-remove-group() {
127 | subheader "Removing User from Group..."
128 | deluser $1 $2
129 | }
130 |
131 | ####################
132 | ## Misc Functions ##
133 | ####################
134 |
135 | # Clean Cron
136 | manage-user-clean-cron() {
137 | subheader "Cleaning User Cron Entry..."
138 | echo -n "" > /tmp/cron
139 | crontab -u $1 /tmp/cron
140 | rm /tmp/cron
141 | }
142 |
143 | # HTTP Directory
144 | manage-user-http-directory() {
145 | subheader "Creating HTTP Directory..."
146 | mkdir -p /home/$1/http/{common,host,logs,secure}
147 |
148 | subheader "Changing HTTP Directory Permissions..."
149 | chown -R $1:$1 /home/$USER/http
150 | find /home/$1/http -type d -exec chmod 770 {} \;
151 |
152 | subheader "Adding User To WWW Group..."
153 | gpasswd -a www-data $1
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/libraries/platform/check.debian.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For Checking Package/Repository Installation Status (Debian)
3 |
4 | # Check If Package Installed
5 | function check_package() {
6 | dpkg -l $1 2> /dev/null | grep -Eq ^ii
7 | }
8 |
9 | # Check If Repository Installed
10 | function check_repository() {
11 | grep -iq $1 /etc/apt/sources.list || [ -f /etc/apt/sources.list.d/$1.list ]
12 | }
13 |
--------------------------------------------------------------------------------
/libraries/platform/check.ubuntu.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For Checking Package/Repository Installation Status (Ubuntu)
3 |
4 | # Check If Package Installed
5 | function check_package() {
6 | dpkg -l $1 2> /dev/null | grep -Eq ^ii
7 | }
8 |
9 | # Check If Repository Installed
10 | function check_repository() {
11 | grep -iq $1 /etc/apt/sources.list || [ -f /etc/apt/sources.list.d/$1.list ]
12 | }
13 |
--------------------------------------------------------------------------------
/libraries/platform/clean.debian-6.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For Cleaning Packages/Files (Debian)
3 |
4 | # Clean Files
5 | function clean_files() {
6 | # Remove Files Not Removed By APT
7 | rm -rf $(grep "not empty so not removed" temp.log | sed "s/[^']*'//;s/'[^']*$//")
8 | }
9 |
10 | # Clean Packages
11 | function clean_packages() {
12 | # Create DPKG Compatible List
13 | string_replace_output_ne "temp.list" "temp.dpkg" "$" " install"
14 |
15 | # Clear DPKG Package Selections
16 | dpkg --clear-selections
17 |
18 | # Set Package Selections
19 | dpkg --set-selections < temp.dpkg
20 |
21 | # Get Selections & Set To Purge
22 | dpkg --get-selections | sed -e "s/deinstall/purge/" > temp.cur
23 |
24 | # Set Package Selections
25 | dpkg --set-selections < temp.cur
26 |
27 | # Update DPKG
28 | DEBIAN_FRONTEND=noninteractive apt-get -qy dselect-upgrade 2>&1 | tee -a temp.log
29 | }
30 |
--------------------------------------------------------------------------------
/libraries/platform/clean.debian-7.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For Cleaning Packages/Files (Debian)
3 |
4 | # Clean Files
5 | function clean_files() {
6 | # Remove Files Not Removed By APT
7 | rm -rf $(grep "not empty so not removed" temp.log | sed "s/[^']*'//;s/'[^']*$//")
8 | }
9 |
10 | # Clean Packages
11 | function clean_packages() {
12 | # Create DPKG Compatible List
13 | string_replace_output_ne "temp.list" "temp.dpkg" "$" " install"
14 |
15 | # Clear DPKG Package Selections
16 | dpkg --clear-selections
17 |
18 | # Set Package Selections
19 | dpkg --set-selections < temp.dpkg
20 |
21 | # Get Selections & Set To Purge
22 | dpkg --get-selections | sed -e "s/deinstall/purge/" > temp.cur
23 |
24 | # Set Package Selections
25 | dpkg --set-selections < temp.cur
26 |
27 | # Update DPKG
28 | DEBIAN_FRONTEND=noninteractive apt-get -qy dselect-upgrade 2>&1 | tee -a temp.log
29 | }
30 |
--------------------------------------------------------------------------------
/libraries/platform/clean.ubuntu-1204.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For Cleaning Packages/Files (Ubuntu 12.04)
3 |
4 | # Clean Files
5 | function clean_files() {
6 | # Remove Files Not Removed By APT
7 | rm -rf $(grep "not empty so not removed" temp.log | sed "s/[^']*'//;s/'[^']*$//")
8 | }
9 |
10 | # Clean Packages
11 | function clean_packages() {
12 | # Create DPKG Compatible List
13 | string_replace_output_ne "temp.list" "temp.dpkg" "$" " install"
14 |
15 | # Clear DPKG Package Selections
16 | dpkg --clear-selections
17 |
18 | # Set Package Selections
19 | dpkg --set-selections < temp.dpkg
20 |
21 | # Get Selections & Set To Purge
22 | dpkg --get-selections | sed -e "s/deinstall/purge/" > temp.cur
23 |
24 | # Set Package Selections
25 | dpkg --set-selections < temp.cur
26 |
27 | # Update DPKG
28 | DEBIAN_FRONTEND=noninteractive apt-get -qy dselect-upgrade 2>&1 | tee -a temp.log
29 | }
30 |
--------------------------------------------------------------------------------
/libraries/platform/daemon.debian-6.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For Handling Daemon Management (Debian 6.x)
3 |
4 | # Add Daemon
5 | function daemon_add() {
6 | if [ -e /etc/init.d/$1 ]; then
7 | update-rc.d $1 defaults
8 | fi
9 | }
10 |
11 | # Remove Daemon
12 | function daemon_remove() {
13 | if [ -e /etc/init.d/$1 ]; then
14 | update-rc.d -f $1 remove
15 | fi
16 | }
17 |
18 | # Enable Daemon
19 | function daemon_enable() {
20 | if [ -e /etc/init.d/$1 ]; then
21 | update-rc.d $1 enable
22 | fi
23 | }
24 |
25 | # Disable Daemon
26 | function daemon_disable() {
27 | if [ -e /etc/init.d/$1 ]; then
28 | update-rc.d $1 disable
29 | fi
30 | }
31 |
32 | # Manage Daemon
33 | function daemon_manage() {
34 | if [ -e /etc/init.d/$1 ]; then
35 | invoke-rc.d $1 $2
36 | fi
37 | }
38 |
--------------------------------------------------------------------------------
/libraries/platform/daemon.debian-7.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For Daemon Management (Debian 7.x)
3 |
4 | # Add Daemon
5 | function daemon_add() {
6 | if [ -e /etc/init/$1.conf ]; then
7 | rename.ul .conf.disabled .conf /etc/init/$1.conf.disabled
8 | elif [ -e /etc/init.d/$1 ]; then
9 | update-rc.d $1 defaults
10 | fi
11 | }
12 |
13 | # Remove Daemon
14 | function daemon_remove() {
15 | if [ -e /etc/init/$1.conf ]; then
16 | rename.ul .conf .conf.disabled /etc/init/$1.conf
17 | elif [ -e /etc/init.d/$1 ]; then
18 | update-rc.d -f $1 remove
19 | fi
20 | }
21 |
22 | # Enable Daemon
23 | function daemon_enable() {
24 | if [ -e /etc/init/$1.conf ]; then
25 | rename.ul .conf.disabled .conf /etc/init/$1.conf.disabled
26 | elif [ -e /etc/init.d/$1 ]; then
27 | update-rc.d $1 enable
28 | fi
29 | }
30 |
31 | # Disable Daemon
32 | function daemon_disable() {
33 | if [ -e /etc/init/$1.conf ]; then
34 | rename.ul .conf .conf.disabled /etc/init/$1.conf
35 | elif [ -e /etc/init.d/$1 ]; then
36 | update-rc.d $1 disable
37 | fi
38 | }
39 |
40 | # Manage Daemon
41 | function daemon_manage() {
42 | if [ -e /etc/init/$1.conf ]; then
43 | service $1 $2
44 | elif [ -e /etc/init.d/$1 ]; then
45 | invoke-rc.d $1 $2
46 | fi
47 | }
48 |
--------------------------------------------------------------------------------
/libraries/platform/daemon.ubuntu-1204.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For Daemon Management (Ubuntu 12.04)
3 |
4 | # Add Daemon
5 | function daemon_add() {
6 | if [ -e /etc/init/$1.conf ]; then
7 | rename.ul .conf.disabled .conf /etc/init/$1.conf.disabled
8 | elif [ -e /etc/init.d/$1 ]; then
9 | update-rc.d $1 defaults
10 | fi
11 | }
12 |
13 | # Remove Daemon
14 | function daemon_remove() {
15 | if [ -e /etc/init/$1.conf ]; then
16 | rename.ul .conf .conf.disabled /etc/init/$1.conf
17 | elif [ -e /etc/init.d/$1 ]; then
18 | update-rc.d -f $1 remove
19 | fi
20 | }
21 |
22 | # Enable Daemon
23 | function daemon_enable() {
24 | if [ -e /etc/init/$1.conf ]; then
25 | rename.ul .conf.disabled .conf /etc/init/$1.conf.disabled
26 | elif [ -e /etc/init.d/$1 ]; then
27 | update-rc.d $1 enable
28 | fi
29 | }
30 |
31 | # Disable Daemon
32 | function daemon_disable() {
33 | if [ -e /etc/init/$1.conf ]; then
34 | rename.ul .conf .conf.disabled /etc/init/$1.conf
35 | elif [ -e /etc/init.d/$1 ]; then
36 | update-rc.d $1 disable
37 | fi
38 | }
39 |
40 | # Manage Daemon
41 | function daemon_manage() {
42 | if [ -e /etc/init/$1.conf ]; then
43 | service $1 $2
44 | elif [ -e /etc/init.d/$1 ]; then
45 | invoke-rc.d $1 $2
46 | fi
47 | }
48 |
--------------------------------------------------------------------------------
/libraries/platform/package.debian.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For Package Management (Debian)
3 |
4 | # Clean Package Cache
5 | function package_clean() {
6 | apt-get clean
7 | }
8 |
9 | # Clean Package List
10 | function package_clean_list() {
11 | echo -n > /var/lib/apt/extended_states
12 | }
13 |
14 | # Install Package(s)
15 | function package_install() {
16 | if [ $UNATTENDED = 1 ]; then
17 | DEBIAN_FRONTEND=noninteractive apt-get -qy install "$*"
18 | else
19 | apt-get -qy install "$@"
20 | fi
21 | }
22 |
23 | # Remove Package(s)
24 | function package_remove() {
25 | if [ $UNATTENDED = 1 ]; then
26 | DEBIAN_FRONTEND=noninteractive apt-get -qy purge "$*"
27 | else
28 | apt-get -qy purge "$@"
29 | fi
30 | }
31 |
32 | # Update Package List
33 | function package_update() {
34 | apt-get update
35 | }
36 |
37 | # Upgrade Packages
38 | function package_upgrade() {
39 | apt-get -qy upgrade
40 | }
41 |
42 | # Add Repository
43 | function repo_add() {
44 | if ! check_repository $1; then
45 | echo -e "$2" > /etc/apt/sources.list.d/$1.list
46 | fi
47 | }
48 |
49 | # Remove Repository
50 | function repo_remove() {
51 | if check_repository $1; then
52 | rm /etc/apt/sources.list.d/$1.list
53 | fi
54 | }
55 |
56 | # Add Repository Key
57 | function repo_key() {
58 | wget "$1" -qO - | apt-key add -
59 | }
60 |
61 | # Add Repository Key (From Server)
62 | function repo_key_server() {
63 | apt-key adv --keyserver "$1" --recv-keys "$2"
64 | }
65 |
--------------------------------------------------------------------------------
/libraries/platform/package.ubuntu.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Functions For Package Management (Ubuntu)
3 |
4 | # Clean Package Cache
5 | function package_clean() {
6 | apt-get clean
7 | }
8 |
9 | # Clean Package List
10 | function package_clean_list() {
11 | echo -n > /var/lib/apt/extended_states
12 | }
13 |
14 | # Install Package(s)
15 | function package_install() {
16 | if [ $UNATTENDED = 1 ]; then
17 | DEBIAN_FRONTEND=noninteractive apt-get -qy install "$*"
18 | else
19 | apt-get -qy install "$@"
20 | fi
21 | }
22 |
23 | # Remove Package(s)
24 | function package_remove() {
25 | if [ $UNATTENDED = 1 ]; then
26 | DEBIAN_FRONTEND=noninteractive apt-get -qy purge "$*"
27 | else
28 | apt-get -qy purge "$@"
29 | fi
30 | }
31 |
32 | # Update Package List
33 | function package_update() {
34 | apt-get update
35 | }
36 |
37 | # Upgrade Packages
38 | function package_upgrade() {
39 | apt-get -qy upgrade
40 | }
41 |
42 | # Add Repository
43 | function repo_add() {
44 | if ! check_repository $1; then
45 | echo -e "$2" > /etc/apt/sources.list.d/$1.list
46 | fi
47 | }
48 |
49 | # Remove Repository
50 | function repo_remove() {
51 | if check_repository $1; then
52 | rm /etc/apt/sources.list.d/$1.list
53 | fi
54 | }
55 |
56 | # Add Repository Key
57 | function repo_key() {
58 | wget "$1" -qO - | apt-key add -
59 | }
60 |
61 | # Add Repository Key (From Server)
62 | function repo_key_server() {
63 | apt-key adv --keyserver "$1" --recv-keys "$2"
64 | }
65 |
--------------------------------------------------------------------------------
/minstall.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script Loader
3 |
4 | # Disable Ctrl+C
5 | trap '' 2
6 |
7 | # Change Directory
8 | cd $(dirname $0)
9 |
10 | # Load Variables
11 | source config.sh
12 |
13 | # Load Libraries (External)
14 | for file in $LIBRARYPATH/external/*.sh; do
15 | # Source Libraries
16 | source $file
17 | done
18 |
19 | # Load Libraries
20 | for file in $LIBRARYPATH/*.sh; do
21 | # Source Libraries
22 | source $file
23 | done
24 |
25 | # Load Module Specific Libraries
26 | for file in $LIBRARYPATH/module/*.sh; do
27 | # Source Libraries
28 | source $file
29 | done
30 |
31 | # Load Platform Specific Libraries
32 | for file in $LIBRARYPATH/platform/*.$DISTRIBUTION.sh $LIBRARYPATH/platform/*.$DISTRIBUTION-$VERSION.sh; do
33 | # Source Libraries
34 | source $file
35 | done
36 |
37 | # Check Arguments
38 | while getopts ":c:hlm:su" option; do
39 | # Argument List
40 | case $option in
41 | # Config File
42 | c)
43 | # Check Config File Existance
44 | if [ -f $OPTARG ]; then
45 | # Print Warning
46 | warning "Loaded Custom Config File \"$OPTARG\"."
47 |
48 | # Set Config File Variable
49 | CONFIGFILE=$OPTARG
50 | # Error Condition
51 | else
52 | # Print Error
53 | error "Custom Config File \"$OPTARG\" does not exist."
54 |
55 | # Exit
56 | exit
57 | fi
58 | ;;
59 | # Help
60 | h)
61 | # Load Help
62 | source $MODULEPATH/help/init.sh
63 |
64 | # Exit
65 | exit
66 | ;;
67 | # Module List
68 | l)
69 | # Load Module Listing Script
70 | source $MODULEPATH/help-modules/init.sh
71 |
72 | # Exit
73 | exit
74 | ;;
75 | # Module Definition
76 | m)
77 | # Set Module List Variable
78 | MODULELIST=$OPTARG,
79 | ;;
80 | # Setup Mode
81 | s)
82 | # Print Warning
83 | warning "Setup Mode Running..."
84 |
85 | # Set Setup Variable State
86 | SETUP=1
87 | ;;
88 | # Unattended Mode
89 | u)
90 | # Print Warning
91 | warning "Unattended Mode Running..."
92 |
93 | # Enable Unattended Mode
94 | UNATTENDED=1
95 | ;;
96 | # No Arguments
97 | \?)
98 | # Load Module Listing Script
99 | source $MODULEPATH/help/init.sh
100 |
101 | # Exit
102 | exit
103 | ;;
104 | # Invalid Argument
105 | :)
106 | # Print Error
107 | error "Option -$OPTARG requires an argument."
108 |
109 | # Exit
110 | exit
111 | ;;
112 | esac
113 | done
114 |
115 | # Setup Mode
116 | if [[ -n "$SETUP" ]]; then
117 | # Create Base Configuration File
118 | cp $LIBRARYPATH/default/config.ini $CONFIGFILE
119 |
120 | # Loop Through Modules
121 | for MODULE in $MODULEPATH/*/config.ini; do
122 | # Check If File Empty
123 | if [ -s $MODULE ]; then
124 | # Append Space
125 | echo >> $CONFIGFILE
126 |
127 | # Append Module Configuration
128 | cat $MODULE >> $CONFIGFILE
129 | fi
130 | done
131 |
132 | # Exit
133 | exit
134 | fi
135 |
136 | # Read Configuration
137 | read_ini $CONFIGFILE
138 |
139 | # Execute Modules
140 | while echo $MODULELIST | grep -q \,; do
141 | # Define Module
142 | MODULE=${MODULELIST%%\,*}
143 |
144 | # Remove Current Module From Module List
145 | MODULELIST=${MODULELIST#*\,}
146 |
147 | # Check If Module Exists
148 | if [ -f $MODULEPATH/$MODULE/init.sh ]; then
149 | # Print Module Description
150 | header $(describe $MODULEPATH/$MODULE/init.sh)
151 |
152 | # Load Module
153 | source $MODULEPATH/$MODULE/init.sh
154 | # Error Condition
155 | else
156 | # Ask If User Wants To Abort
157 | if question --default no "Module $MODULE not found. Do you want to abort? (y/N)" || [ $UNATTENDED = 1 ]; then
158 | # Print Message
159 | error "Module $MODULE not found. Aborting."
160 |
161 | # Exit Script
162 | exit
163 | fi
164 | fi
165 |
166 | # Remove Temporary Files
167 | rm -f temp.*
168 |
169 | # Debug Pause
170 | if [ $(read_variable minstall__debug) = 1 ]; then
171 | # Enable Ctrl+C
172 | trap 2
173 |
174 | # Wait For User Input
175 | read -p "Press any key to continue or press Ctrl+C to exit..."
176 |
177 | # Disable Ctrl+C
178 | trap '' 2
179 | fi
180 | done
181 |
182 | # Enable Ctrl+C
183 | trap 2
184 |
--------------------------------------------------------------------------------
/modules/clean-packages/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/clean-packages/config.ini
--------------------------------------------------------------------------------
/modules/clean-packages/custom/custom:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/clean-packages/custom/custom
--------------------------------------------------------------------------------
/modules/clean-packages/debian-6/base-hardware-x32:
--------------------------------------------------------------------------------
1 | cpio
2 | dmsetup
3 | gettext-base
4 | grub-common
5 | grub-pc
6 | initramfs-tools
7 | isc-dhcp-client
8 | isc-dhcp-common
9 | klibc-utils
10 | libdevmapper1.02.1
11 | libfreetype6
12 | libklibc
13 | libudev0
14 | libuuid-perl
15 | linux-base
16 | module-init-tools
17 | ucf
18 | udev
19 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-6/base-hardware-x64:
--------------------------------------------------------------------------------
1 | cpio
2 | dmsetup
3 | gettext-base
4 | grub-common
5 | grub-pc
6 | initramfs-tools
7 | isc-dhcp-client
8 | isc-dhcp-common
9 | klibc-utils
10 | libdevmapper1.02.1
11 | libfreetype6
12 | libklibc
13 | libudev0
14 | libuuid-perl
15 | linux-base
16 | module-init-tools
17 | ucf
18 | udev
19 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-6/base-x32:
--------------------------------------------------------------------------------
1 | adduser
2 | apt
3 | apt-utils
4 | base-files
5 | base-passwd
6 | bash
7 | bsdmainutils
8 | bsdutils
9 | bzip2
10 | coreutils
11 | cron
12 | dash
13 | debconf
14 | debconf-i18n
15 | debian-archive-keyring
16 | debianutils
17 | diffutils
18 | dpkg
19 | e2fslibs
20 | e2fsprogs
21 | findutils
22 | gcc-4.4-base
23 | gnupg
24 | gpgv
25 | grep
26 | groff-base
27 | gzip
28 | hostname
29 | ifupdown
30 | inetutils-syslogd
31 | initscripts
32 | insserv
33 | install-info
34 | iproute
35 | iptables
36 | iputils-ping
37 | iputils-tracepath
38 | less
39 | libacl1
40 | libattr1
41 | libblkid1
42 | libbz2-1.0
43 | libc-bin
44 | libc6
45 | libcomerr2
46 | libdb4.7
47 | libdb4.8
48 | libexpat1
49 | libgcc1
50 | libgdbm3
51 | liblocale-gettext-perl
52 | liblzma2
53 | libncurses5
54 | libncursesw5
55 | libnewt0.52
56 | libnfnetlink0
57 | libpam-modules
58 | libpam-runtime
59 | libpam0g
60 | libpopt0
61 | libreadline6
62 | libselinux1
63 | libsepol1
64 | libslang2
65 | libsqlite3-0
66 | libss2
67 | libssl0.9.8
68 | libstdc++6
69 | libtext-charwidth-perl
70 | libtext-iconv-perl
71 | libtext-wrapi18n-perl
72 | libusb-0.1-4
73 | libuuid1
74 | locales
75 | login
76 | logrotate
77 | lsb-base
78 | lsb-release
79 | lsof
80 | man-db
81 | manpages
82 | mawk
83 | mime-support
84 | mount
85 | nano
86 | ncurses-base
87 | ncurses-bin
88 | net-tools
89 | netbase
90 | passwd
91 | perl
92 | perl-base
93 | perl-modules
94 | procps
95 | psmisc
96 | python
97 | python-minimal
98 | python-support
99 | python2.6
100 | python2.6-minimal
101 | readline-common
102 | sed
103 | sensible-utils
104 | sysv-rc
105 | sysvinit
106 | sysvinit-utils
107 | tar
108 | traceroute
109 | tzdata
110 | util-linux
111 | wget
112 | whiptail
113 | xz-utils
114 | zlib1g
115 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-6/base-x64:
--------------------------------------------------------------------------------
1 | adduser
2 | apt
3 | apt-utils
4 | base-files
5 | base-passwd
6 | bash
7 | bsdmainutils
8 | bsdutils
9 | bzip2
10 | coreutils
11 | cron
12 | dash
13 | debconf
14 | debconf-i18n
15 | debian-archive-keyring
16 | debianutils
17 | diffutils
18 | dpkg
19 | e2fslibs
20 | e2fsprogs
21 | findutils
22 | gcc-4.4-base
23 | gnupg
24 | gpgv
25 | grep
26 | groff-base
27 | gzip
28 | hostname
29 | ifupdown
30 | inetutils-syslogd
31 | initscripts
32 | insserv
33 | install-info
34 | iproute
35 | iptables
36 | iputils-ping
37 | iputils-tracepath
38 | less
39 | libacl1
40 | libattr1
41 | libblkid1
42 | libbz2-1.0
43 | libc-bin
44 | libc6
45 | libcomerr2
46 | libdb4.7
47 | libdb4.8
48 | libexpat1
49 | libgcc1
50 | libgdbm3
51 | liblocale-gettext-perl
52 | liblzma2
53 | libncurses5
54 | libncursesw5
55 | libnewt0.52
56 | libnfnetlink0
57 | libpam-modules
58 | libpam-runtime
59 | libpam0g
60 | libpopt0
61 | libreadline6
62 | libselinux1
63 | libsepol1
64 | libslang2
65 | libsqlite3-0
66 | libss2
67 | libssl0.9.8
68 | libstdc++6
69 | libtext-charwidth-perl
70 | libtext-iconv-perl
71 | libtext-wrapi18n-perl
72 | libusb-0.1-4
73 | libuuid1
74 | locales
75 | login
76 | logrotate
77 | lsb-base
78 | lsb-release
79 | lsof
80 | man-db
81 | manpages
82 | mawk
83 | mime-support
84 | mount
85 | nano
86 | ncurses-base
87 | ncurses-bin
88 | net-tools
89 | netbase
90 | passwd
91 | perl
92 | perl-base
93 | perl-modules
94 | procps
95 | psmisc
96 | python
97 | python-minimal
98 | python-support
99 | python2.6
100 | python2.6-minimal
101 | readline-common
102 | sed
103 | sensible-utils
104 | sysv-rc
105 | sysvinit
106 | sysvinit-utils
107 | tar
108 | traceroute
109 | tzdata
110 | util-linux
111 | wget
112 | whiptail
113 | xz-utils
114 | zlib1g
115 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-6/script-post.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Post Clean Commands (Debian 6)
3 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-6/script-pre.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Pre Clean Commands (Debian 6)
3 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-6/specific-hardware-x32:
--------------------------------------------------------------------------------
1 | linux-image-2.6.32-5-686
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-6/specific-hardware-x64:
--------------------------------------------------------------------------------
1 | linux-image-2.6.32-5-amd64
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-6/specific-xenpv-x32:
--------------------------------------------------------------------------------
1 | linux-image-2.6.32-5-xen-686
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-6/specific-xenpv-x64:
--------------------------------------------------------------------------------
1 | linux-image-2.6.32-5-xen-amd64
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-7/base-hardware-x32:
--------------------------------------------------------------------------------
1 | dmsetup
2 | gettext-base
3 | grub-common
4 | grub-pc
5 | grub-pc-bin
6 | grub2-common
7 | isc-dhcp-client
8 | isc-dhcp-common
9 | libasprintf0c2
10 | libdevmapper1.02.1
11 | libfreetype6
12 | libfuse2
13 | libuuid-perl
14 | linux-base
15 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-7/base-hardware-x64:
--------------------------------------------------------------------------------
1 | dmsetup:amd64
2 | gettext-base:amd64
3 | grub-common:amd64
4 | grub-pc:amd64
5 | grub-pc-bin:amd64
6 | grub2-common:amd64
7 | isc-dhcp-client:amd64
8 | isc-dhcp-common:amd64
9 | libasprintf0c2:amd64
10 | libdevmapper1.02.1:amd64
11 | libfreetype6:amd64
12 | libfuse2:amd64
13 | libuuid-perl:amd64
14 | linux-base:amd64
--------------------------------------------------------------------------------
/modules/clean-packages/debian-7/base-x32:
--------------------------------------------------------------------------------
1 | adduser
2 | apt
3 | apt-utils
4 | base-files
5 | base-passwd
6 | bash
7 | bsdmainutils
8 | bsdutils
9 | bzip2
10 | coreutils
11 | cpio
12 | cron
13 | dash
14 | debconf
15 | debconf-i18n
16 | debian-archive-keyring
17 | debianutils
18 | dialog
19 | diffutils
20 | dpkg
21 | e2fslibs
22 | e2fsprogs
23 | findutils
24 | gcc-4.7-base
25 | gnupg
26 | gpgv
27 | grep
28 | groff-base
29 | gzip
30 | hostname
31 | ifupdown
32 | inetutils-syslogd
33 | initramfs-tools
34 | initscripts
35 | insserv
36 | install-info
37 | iproute
38 | iptables
39 | iputils-ping
40 | iputils-tracepath
41 | klibc-utils
42 | kmod
43 | less
44 | libacl1
45 | libapt-inst1.5
46 | libapt-pkg4.12
47 | libattr1
48 | libblkid1
49 | libbz2-1.0
50 | libc-bin
51 | libc6
52 | libclass-isa-perl
53 | libcomerr2
54 | libdb5.1
55 | libdbus-1-3
56 | libexpat1
57 | libgcc1
58 | libgcrypt11
59 | libgdbm3
60 | libgnutls26
61 | libgpg-error0
62 | libidn11
63 | libjson0
64 | libklibc
65 | libkmod2
66 | liblocale-gettext-perl
67 | liblzma5
68 | libmount1
69 | libncurses5
70 | libncursesw5
71 | libnewt0.52
72 | libnfnetlink0
73 | libnih-dbus1
74 | libnih1
75 | libp11-kit0
76 | libpam-modules
77 | libpam-modules-bin
78 | libpam-runtime
79 | libpam0g
80 | libpipeline1
81 | libpopt0
82 | libprocps0
83 | libreadline6
84 | libselinux1
85 | libsemanage-common
86 | libsemanage1
87 | libsepol1
88 | libslang2
89 | libsqlite3-0
90 | libss2
91 | libssl1.0.0
92 | libstdc++6
93 | libswitch-perl
94 | libtasn1-3
95 | libtext-charwidth-perl
96 | libtext-iconv-perl
97 | libtext-wrapi18n-perl
98 | libtinfo5
99 | libudev0
100 | libusb-0.1-4
101 | libustr-1.0-1
102 | libuuid1
103 | locales
104 | login
105 | logrotate
106 | lsb-base
107 | lsb-release
108 | lsof
109 | makedev
110 | man-db
111 | manpages
112 | mawk
113 | mime-support
114 | mount
115 | mountall
116 | multiarch-support
117 | nano
118 | ncurses-base
119 | ncurses-bin
120 | net-tools
121 | netbase
122 | passwd
123 | perl
124 | perl-base
125 | perl-modules
126 | plymouth
127 | procps
128 | psmisc
129 | python
130 | python-minimal
131 | python2.7
132 | python2.7-minimal
133 | readline-common
134 | sed
135 | sensible-utils
136 | sysv-rc
137 | sysvinit-utils
138 | tar
139 | traceroute
140 | tzdata
141 | ucf
142 | udev
143 | upstart
144 | util-linux
145 | wget
146 | whiptail
147 | xz-utils
148 | zlib1g
149 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-7/base-x64:
--------------------------------------------------------------------------------
1 | adduser
2 | apt:amd64
3 | apt-utils:amd64
4 | base-files:amd64
5 | base-passwd:amd64
6 | bash:amd64
7 | bsdmainutils:amd64
8 | bsdutils:amd64
9 | bzip2:amd64
10 | coreutils:amd64
11 | cpio:amd64
12 | cron:amd64
13 | dash:amd64
14 | debconf
15 | debconf-i18n
16 | debian-archive-keyring
17 | debianutils:amd64
18 | dialog:amd64
19 | diffutils:amd64
20 | dpkg:amd64
21 | e2fslibs:amd64
22 | e2fsprogs:amd64
23 | findutils:amd64
24 | gcc-4.7-base:amd64
25 | gnupg:amd64
26 | gpgv:amd64
27 | grep:amd64
28 | groff-base:amd64
29 | gzip:amd64
30 | hostname:amd64
31 | ifupdown:amd64
32 | inetutils-syslogd:amd64
33 | initramfs-tools
34 | initscripts:amd64
35 | insserv:amd64
36 | install-info:amd64
37 | iproute:amd64
38 | iptables:amd64
39 | iputils-ping:amd64
40 | iputils-tracepath:amd64
41 | klibc-utils:amd64
42 | kmod:amd64
43 | less:amd64
44 | libacl1:amd64
45 | libapt-inst1.5:amd64
46 | libapt-pkg4.12:amd64
47 | libattr1:amd64
48 | libblkid1:amd64
49 | libbz2-1.0:amd64
50 | libc-bin:amd64
51 | libc6:amd64
52 | libclass-isa-perl
53 | libcomerr2:amd64
54 | libdb5.1:amd64
55 | libdbus-1-3:amd64
56 | libexpat1:amd64
57 | libgcc1:amd64
58 | libgcrypt11:amd64
59 | libgdbm3:amd64
60 | libgnutls26:amd64
61 | libgpg-error0:amd64
62 | libidn11:amd64
63 | libjson0:amd64
64 | libklibc:amd64
65 | libkmod2:amd64
66 | liblocale-gettext-perl:amd64
67 | liblzma5:amd64
68 | libmount1:amd64
69 | libncurses5:amd64
70 | libncursesw5:amd64
71 | libnewt0.52:amd64
72 | libnfnetlink0:amd64
73 | libnih-dbus1:amd64
74 | libnih1:amd64
75 | libp11-kit0:amd64
76 | libpam-modules:amd64
77 | libpam-modules-bin:amd64
78 | libpam-runtime
79 | libpam0g:amd64
80 | libpipeline1:amd64
81 | libpopt0:amd64
82 | libprocps0:amd64
83 | libreadline6:amd64
84 | libselinux1:amd64
85 | libsemanage-common
86 | libsemanage1:amd64
87 | libsepol1:amd64
88 | libslang2:amd64
89 | libsqlite3-0:amd64
90 | libss2:amd64
91 | libssl1.0.0:amd64
92 | libstdc++6:amd64
93 | libswitch-perl
94 | libtasn1-3:amd64
95 | libtext-charwidth-perl:amd64
96 | libtext-iconv-perl:amd64
97 | libtext-wrapi18n-perl
98 | libtinfo5:amd64
99 | libudev0:amd64
100 | libusb-0.1-4:amd64
101 | libustr-1.0-1:amd64
102 | libuuid1:amd64
103 | locales
104 | login:amd64
105 | logrotate:amd64
106 | lsb-base
107 | lsb-release
108 | lsof:amd64
109 | makedev
110 | man-db:amd64
111 | manpages
112 | mawk:amd64
113 | mime-support
114 | mount:amd64
115 | mountall:amd64
116 | multiarch-support:amd64
117 | nano:amd64
118 | ncurses-base
119 | ncurses-bin:amd64
120 | net-tools:amd64
121 | netbase
122 | passwd:amd64
123 | perl:amd64
124 | perl-base:amd64
125 | perl-modules
126 | plymouth:amd64
127 | procps:amd64
128 | psmisc:amd64
129 | python
130 | python-minimal
131 | python2.7:amd64
132 | python2.7-minimal:amd64
133 | readline-common
134 | sed:amd64
135 | sensible-utils
136 | sysv-rc
137 | sysvinit-utils:amd64
138 | tar:amd64
139 | traceroute:amd64
140 | tzdata
141 | ucf
142 | udev:amd64
143 | upstart:amd64
144 | util-linux:amd64
145 | wget:amd64
146 | whiptail:amd64
147 | xz-utils:amd64
148 | zlib1g:amd64
149 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-7/script-post.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Post Clean Commands (Debian 7)
3 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-7/script-pre.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Pre Clean Commands (Debian 7)
3 |
4 | # Remove Sendmail
5 | if check_package sendmail-base; then
6 | if ! check_package update-inetd; then
7 | package_install update-inetd
8 | fi
9 | package_remove sendmail*
10 | if [ -e /var/lib/dpkg/info/sendmail-base.postrm ]; then
11 | echo "exit 0" > /var/lib/dpkg/info/sendmail-base.postrm
12 | fi
13 | fi
14 |
15 | # Iterate Through Package List & Install
16 | cat temp.list | while read line; do
17 | if ! check_package $line || ! check_package $line:i386; then
18 | package_install $line
19 | fi
20 | done
21 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-7/specific-hardware-x32:
--------------------------------------------------------------------------------
1 | linux-image-3.2.0-4-686-pae
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-7/specific-hardware-x64:
--------------------------------------------------------------------------------
1 | linux-image-3.2.0-4-amd64
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-7/specific-xenpv-x32:
--------------------------------------------------------------------------------
1 | linux-image-3.2.0-4-686-pae
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/debian-7/specific-xenpv-x64:
--------------------------------------------------------------------------------
1 | linux-image-3.2.0-4-amd64
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Clean: Packages
3 |
4 | # Module Warning
5 | warning "This module will remove all non-essential packages on this system, you have been warned!"
6 | if ! (question --default yes "Do you still want to run this module and purge all non-essential packages? (Y/n)" || [ $UNATTENDED = 1 ]); then
7 | # Skipped Message
8 | subheader "Skipping Module..."
9 |
10 | # Skip Module
11 | continue
12 | fi
13 |
14 | # Update Package Lists
15 | subheader "Updating Package Lists..."
16 | package_update
17 |
18 | # Create Package List
19 | subheader "Creating Package List..."
20 | cp $MODULEPATH/$MODULE/$DISTRIBUTION-$VERSION/base-$ARCHITECTURE temp.list
21 |
22 | # Check Platform
23 | if [ $PLATFORM = "hardware" ]; then
24 | # Append Hardware Package List
25 | cat $MODULEPATH/$MODULE/$DISTRIBUTION-$VERSION/base-hardware-$ARCHITECTURE >> temp.list
26 | fi
27 |
28 | # Check Platform Package List
29 | if [ -f $MODULEPATH/$MODULE/$DISTRIBUTION-$VERSION/specific-$PLATFORM-$ARCHITECTURE ]; then
30 | # Append Platform Package List
31 | cat $MODULEPATH/$MODULE/$DISTRIBUTION-$VERSION/specific-$PLATFORM-$ARCHITECTURE >> temp.list
32 | fi
33 |
34 | # Append Custom Package List
35 | cat $MODULEPATH/$MODULE/custom/custom >> temp.list
36 |
37 | # Sort Package List
38 | sort -o temp.list temp.list
39 |
40 | # Run Pre Install Commands
41 | source $MODULEPATH/$MODULE/$DISTRIBUTION-$VERSION/script-pre.sh
42 |
43 | # Clean Packages
44 | subheader "Cleaning Packages..."
45 | clean_packages
46 |
47 | # Clean Files
48 | subheader "Cleaning Files..."
49 | clean_files
50 |
51 | # Run Post Install Commands
52 | source $MODULEPATH/$MODULE/$DISTRIBUTION-$VERSION/script-post.sh
53 |
54 | # Clean Packages
55 | package_clean
56 |
57 | # Clean Package List
58 | package_clean_list
59 |
60 | # Show Warnings
61 | warning "All SSH Servers have been uninstalled! Be sure to install an SSH server again using the modules provided (e.g install-ssh)!"
62 | warning "Also, it is recommend that you restart your server after installing an SSH server to ensure everything is functional and to ensure that all changes have been correctly applied."
63 |
--------------------------------------------------------------------------------
/modules/clean-packages/ubuntu-1204/base-hardware-x32:
--------------------------------------------------------------------------------
1 | crda
2 | dmsetup
3 | gettext-base
4 | grub-common
5 | grub-gfxpayload-lists
6 | grub-pc
7 | grub-pc-bin
8 | grub2-common
9 | isc-dhcp-client
10 | isc-dhcp-common
11 | libdevmapper1.02.1
12 | libfreetype6
13 | libfuse2
14 | libnl-3-200
15 | libnl-genl-3-200
16 | linux-firmware
17 | ucf
18 | wireless-regdb
19 |
--------------------------------------------------------------------------------
/modules/clean-packages/ubuntu-1204/base-hardware-x64:
--------------------------------------------------------------------------------
1 | crda
2 | dmsetup
3 | gettext-base
4 | grub-common
5 | grub-gfxpayload-lists
6 | grub-pc
7 | grub-pc-bin
8 | grub2-common
9 | isc-dhcp-client
10 | isc-dhcp-common
11 | libdevmapper1.02.1
12 | libfreetype6
13 | libfuse2
14 | libnl-3-200
15 | libnl-genl-3-200
16 | linux-firmware
17 | ucf
18 | wireless-regdb
19 |
--------------------------------------------------------------------------------
/modules/clean-packages/ubuntu-1204/base-x32:
--------------------------------------------------------------------------------
1 | adduser
2 | apt
3 | apt-utils
4 | base-files
5 | base-passwd
6 | bash
7 | bsdutils
8 | busybox-initramfs
9 | bzip2
10 | coreutils
11 | cpio
12 | cron
13 | dash
14 | debconf
15 | debianutils
16 | diffutils
17 | dpkg
18 | e2fslibs
19 | e2fsprogs
20 | findutils
21 | gcc-4.6-base
22 | gnupg
23 | gpgv
24 | grep
25 | gzip
26 | hostname
27 | ifupdown
28 | inetutils-ping
29 | inetutils-syslogd
30 | inetutils-traceroute
31 | initramfs-tools
32 | initramfs-tools-bin
33 | initscripts
34 | insserv
35 | install-info
36 | iproute
37 | iptables
38 | klibc-utils
39 | libacl1
40 | libapt-inst1.4
41 | libapt-pkg4.12
42 | libattr1
43 | libblkid1
44 | libbz2-1.0
45 | libc-bin
46 | libc6
47 | libcomerr2
48 | libdb5.1
49 | libdbus-1-3
50 | libdrm-intel1
51 | libdrm-nouveau1a
52 | libdrm-radeon1
53 | libdrm2
54 | libffi6
55 | libgcc1
56 | libglib2.0-0
57 | libidn11
58 | libklibc
59 | liblzma5
60 | libmount1
61 | libncurses5
62 | libncursesw5
63 | libnewt0.52
64 | libnfnetlink0
65 | libnih-dbus1
66 | libnih1
67 | libpam-modules
68 | libpam-modules-bin
69 | libpam-runtime
70 | libpam0g
71 | libpciaccess0
72 | libpcre3
73 | libplymouth2
74 | libpng12-0
75 | libpopt0
76 | libreadline6
77 | libselinux1
78 | libslang2
79 | libss2
80 | libssl1.0.0
81 | libstdc++6
82 | libtinfo5
83 | libudev0
84 | libusb-0.1-4
85 | libuuid1
86 | login
87 | logrotate
88 | lsb-base
89 | makedev
90 | mawk
91 | module-init-tools
92 | mount
93 | mountall
94 | multiarch-support
95 | nano
96 | ncurses-base
97 | ncurses-bin
98 | net-tools
99 | netbase
100 | passwd
101 | perl-base
102 | plymouth
103 | procps
104 | readline-common
105 | sed
106 | sensible-utils
107 | sysv-rc
108 | sysvinit-utils
109 | tar
110 | tzdata
111 | ubuntu-keyring
112 | udev
113 | upstart
114 | util-linux
115 | wget
116 | whiptail
117 | xz-utils
118 | zlib1g
119 |
--------------------------------------------------------------------------------
/modules/clean-packages/ubuntu-1204/base-x64:
--------------------------------------------------------------------------------
1 | adduser
2 | apt
3 | apt-utils
4 | base-files
5 | base-passwd
6 | bash
7 | bsdutils
8 | busybox-initramfs
9 | bzip2
10 | coreutils
11 | cpio
12 | cron
13 | dash
14 | debconf
15 | debianutils
16 | diffutils
17 | dpkg
18 | e2fslibs
19 | e2fsprogs
20 | findutils
21 | gcc-4.6-base
22 | gnupg
23 | gpgv
24 | grep
25 | gzip
26 | hostname
27 | ifupdown
28 | inetutils-ping
29 | inetutils-syslogd
30 | inetutils-traceroute
31 | initramfs-tools
32 | initramfs-tools-bin
33 | initscripts
34 | insserv
35 | install-info
36 | iproute
37 | iptables
38 | klibc-utils
39 | libacl1
40 | libapt-inst1.4
41 | libapt-pkg4.12
42 | libattr1
43 | libblkid1
44 | libbz2-1.0
45 | libc-bin
46 | libc6
47 | libcomerr2
48 | libdb5.1
49 | libdbus-1-3
50 | libdrm-intel1
51 | libdrm-nouveau1a
52 | libdrm-radeon1
53 | libdrm2
54 | libffi6
55 | libgcc1
56 | libglib2.0-0
57 | libidn11
58 | libklibc
59 | liblzma5
60 | libmount1
61 | libncurses5
62 | libncursesw5
63 | libnewt0.52
64 | libnfnetlink0
65 | libnih-dbus1
66 | libnih1
67 | libpam-modules
68 | libpam-modules-bin
69 | libpam-runtime
70 | libpam0g
71 | libpciaccess0
72 | libpcre3
73 | libplymouth2
74 | libpng12-0
75 | libpopt0
76 | libreadline6
77 | libselinux1
78 | libslang2
79 | libss2
80 | libssl1.0.0
81 | libstdc++6
82 | libtinfo5
83 | libudev0
84 | libusb-0.1-4
85 | libuuid1
86 | login
87 | logrotate
88 | lsb-base
89 | makedev
90 | mawk
91 | module-init-tools
92 | mount
93 | mountall
94 | multiarch-support
95 | nano
96 | ncurses-base
97 | ncurses-bin
98 | net-tools
99 | netbase
100 | passwd
101 | perl-base
102 | plymouth
103 | procps
104 | readline-common
105 | sed
106 | sensible-utils
107 | sysv-rc
108 | sysvinit-utils
109 | tar
110 | tzdata
111 | ubuntu-keyring
112 | udev
113 | upstart
114 | util-linux
115 | wget
116 | whiptail
117 | xz-utils
118 | zlib1g
119 |
--------------------------------------------------------------------------------
/modules/clean-packages/ubuntu-1204/script-post.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Post Clean Commands (Ubuntu 12.04)
3 |
--------------------------------------------------------------------------------
/modules/clean-packages/ubuntu-1204/script-pre.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Pre Clean Commands (Ubuntu 12.04)
3 |
--------------------------------------------------------------------------------
/modules/clean-packages/ubuntu-1204/specific-hardware-x32:
--------------------------------------------------------------------------------
1 | linux-image-3.2.0-40-generic-pae
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/ubuntu-1204/specific-hardware-x64:
--------------------------------------------------------------------------------
1 | linux-image-3.2.0-40-generic
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/ubuntu-1204/specific-xenpv-x32:
--------------------------------------------------------------------------------
1 | linux-image-3.2.0-40-virtual
2 |
--------------------------------------------------------------------------------
/modules/clean-packages/ubuntu-1204/specific-xenpv-x64:
--------------------------------------------------------------------------------
1 | linux-image-3.2.0-40-virtual
2 |
--------------------------------------------------------------------------------
/modules/clean-upgrade/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/clean-upgrade/config.ini
--------------------------------------------------------------------------------
/modules/clean-upgrade/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Clean: Upgrade System
3 |
4 | # Update Package Lists
5 | subheader "Updating Package Lists..."
6 | package_update
7 |
8 | # Upgrade Packages
9 | subheader "Upgrading Packages..."
10 | package_upgrade
11 |
12 | # Clean Package Cache
13 | subheader "Cleaning Package Cache..."
14 | package_clean
15 |
16 | # Common Clean
17 | common-clean
18 |
--------------------------------------------------------------------------------
/modules/configure-general-system/config.ini:
--------------------------------------------------------------------------------
1 | ; Configure (General): System Configuration
2 | ; General system configuration options such as shell changes, timezone changes and bash and getty setting modifications.
3 | [configure_general_system]
4 | ; BASH History
5 | ; This flag enables or disables BASH history system wide. To enable set value to 1, to disable set to 0.
6 | bash_history=0
7 | ; Enable Additional Getty Instances
8 | ; This flag enables or disables extra Getty instances. These extra instances are typically redundant on virtual private servers and can thus be disabled to save memory. To enable set value to 1, to disable set to 0.
9 | getty_extra=0
10 | ; System Shell
11 | ; This variable will change the default system shell to the option defined. User shell will remain unchanged. Available options are bash and dash. To skip, set value to 0.
12 | shell="dash"
13 | ; System Timezone
14 | ; This variable will change the system timezone to the option defined. Value must be in standard timezone format (Available here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones). To skip, set value to 0.
15 | timezone="Australia/Sydney"
16 |
--------------------------------------------------------------------------------
/modules/configure-general-system/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Configure (General): System Configuration
3 |
4 | # Enable BASH History
5 | if question --default no "Do you want to enable BASH history? (y/N)" || [ $(read_variable_module bash_history) = 1 ]; then
6 | subheader "Enabling BASH History..."
7 | rm /etc/profile.d/disable_history.sh &> /dev/null
8 | # Disable BASH History
9 | else
10 | subheader "Disabling BASH History..."
11 | echo "unset HISTFILE" > /etc/profile.d/disable_history.sh
12 | fi
13 |
14 | # Enable Additional Getty Instances
15 | if question --default no "Do you want to enable extra getty instances (uneeded on virtual machines, can save memory if disabled)? (y/N)" || [ $(read_variable_module getty_extra) = 1 ]; then
16 | subheader "Enabling Additional Getty Instances..."
17 | if [ $DISTRIBUTION = "debian" ]; then
18 | sed -e 's/^#\([2-6].*getty.*\)/\1/' -i /etc/inittab
19 | elif [ $DISTRIBUTION = "ubuntu" ]; then
20 | rename.ul .conf.disabled .conf /etc/init/tty{3..6}.conf.disabled &> /dev/null
21 | fi
22 | # Disable Additional Getty Instances
23 | else
24 | subheader "Disabling Additional Getty Instances..."
25 | if [ $DISTRIBUTION = "debian" ]; then
26 | sed -e "s/\(^[2-6].*getty.*\)/#\1/" -i /etc/inittab
27 | elif [ $DISTRIBUTION = "ubuntu" ]; then
28 | rename.ul .conf .conf.disabled /etc/init/tty{3..6}.conf &> /dev/null
29 | fi
30 | fi
31 |
32 | # Change Default System Shell
33 | if question --default yes "Do you want to change the default system shell? (Y/n)" || [ $(read_variable_module shell) != 0 ]; then
34 | subheader "Changing Default System Shell..."
35 | # Attended Mode
36 | if [ $UNATTENDED = 0 ]; then
37 | dpkg-reconfigure dash
38 | # Unattended Mode
39 | else
40 | # Set BASH As Default
41 | if [ $(read_variable_module shell) = "bash" ]; then
42 | ln -fs bash /bin/sh
43 | ln -fs dash /bin/sh.distrib
44 | ln -fs bash.1.gz /usr/share/man/man1/sh.1.gz
45 | ln -fs dash.1.gz /usr/share/man/man1/sh.distrib.1.gz
46 | # Set DASH As Default
47 | elif [ $(read_variable_module shell) = "dash" ]; then
48 | ln -fs dash /bin/sh
49 | ln -fs bash /bin/sh.distrib
50 | ln -fs dash.1.gz /usr/share/man/man1/sh.1.gz
51 | ln -fs bash.1.gz /usr/share/man/man1/sh.distrib.1.gz
52 | # Unsupported Condition
53 | else
54 | warning "Unsupported value for default shell, currently bash and dash are supported."
55 | fi
56 | fi
57 | fi
58 |
59 | # Change System Timezone
60 | if question --default yes "Do you want to change the system timezone? (Y/n)" || [ $(read_variable_module timezone) != 0 ]; then
61 | subheader "Changing System Timezone..."
62 | # Attended Mode
63 | if [ $UNATTENDED = 0 ]; then
64 | # Set Timezone Manually
65 | dpkg-reconfigure tzdata
66 | # Unattended Mode
67 | else
68 | # Check Timezone Existance
69 | if [ -f /usr/share/zoneinfo/$(read_variable_module timezone) ]; then
70 | # Set Timezone From File
71 | cp /usr/share/zoneinfo/$(read_variable_module timezone) /etc/localtime
72 | echo $(read_variable_module timezone) > /etc/timezone
73 | dpkg-reconfigure -f noninteractive tzdata
74 | # Unsupported Timezone
75 | else
76 | # Show Warning
77 | warning "Timezone does not exist, please ensure you entered a valid timezone!"
78 | fi
79 | fi
80 | fi
81 |
--------------------------------------------------------------------------------
/modules/configure-general-user/config.ini:
--------------------------------------------------------------------------------
1 | ; Configure (General): User Files/Settings
2 | ; Change options relating to user files and settings such as skeleton files and the root crontab.
3 | [configure_general_user]
4 | ; Clean & Update Default User Files
5 | ; Clean out the default files in /etc/skel and replace with minimal files. To enable set value to 1, to disable set to 0.
6 | clean_default_skel=1
7 | ; Clean & Wipe Root Crontab
8 | ; Clean and wipe the user crontab. Warning, will delete any content in the root crontab. To enable set value to 1, to disable set to 0.
9 | clean_root_crontab=1
10 |
--------------------------------------------------------------------------------
/modules/configure-general-user/debian-6/.bashrc:
--------------------------------------------------------------------------------
1 | [ -z "$PS1" ] && return
2 | shopt -s checkwinsize
3 |
4 | if [ -x /usr/bin/tput ] && tput setaf 1 >& /dev/null; then
5 | color_prompt=yes
6 | fi
7 |
8 | if [ "$color_prompt" = yes ]; then
9 | PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
10 | else
11 | PS1='\u@\h:\w\$ '
12 | fi
13 | unset color_prompt
14 |
15 | if [ -x /usr/bin/dircolors ]; then
16 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
17 | alias ls='ls --color=auto'
18 | fi
19 |
20 | umask o=
21 |
--------------------------------------------------------------------------------
/modules/configure-general-user/debian-6/.profile:
--------------------------------------------------------------------------------
1 | if [ -f "$HOME/.bashrc" ]; then
2 | . "$HOME/.bashrc"
3 | fi
4 |
--------------------------------------------------------------------------------
/modules/configure-general-user/debian-7/.bashrc:
--------------------------------------------------------------------------------
1 | [ -z "$PS1" ] && return
2 | shopt -s checkwinsize
3 |
4 | if [ -x /usr/bin/tput ] && tput setaf 1 >& /dev/null; then
5 | color_prompt=yes
6 | fi
7 |
8 | if [ "$color_prompt" = yes ]; then
9 | PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
10 | else
11 | PS1='\u@\h:\w\$ '
12 | fi
13 | unset color_prompt
14 |
15 | if [ -x /usr/bin/dircolors ]; then
16 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
17 | alias ls='ls --color=auto'
18 | fi
19 |
20 | umask o=
21 |
--------------------------------------------------------------------------------
/modules/configure-general-user/debian-7/.profile:
--------------------------------------------------------------------------------
1 | if [ -f "$HOME/.bashrc" ]; then
2 | . "$HOME/.bashrc"
3 | fi
4 |
--------------------------------------------------------------------------------
/modules/configure-general-user/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Configure (General): User Files/Settings
3 |
4 | # Clean & Update Default User Files
5 | if question --default yes "Do you want to clean and update default user files (in /etc/skel)? (Y/n)" || [ $(read_variable_module clean_default_skel) = 1 ]; then
6 | subheader "Cleaning Default User Files..."
7 | # Remove Skel Files
8 | rm -rf /etc/skel/.??* /etc/skel/* &> /dev/null
9 |
10 | # Update Skel Files
11 | cp -a -R $MODULEPATH/$MODULE/$DISTRIBUTION-$VERSION/.??* /etc/skel
12 |
13 | # Remove Home Files
14 | rm -rf ~/.??* &> /dev/null
15 |
16 | # Update Home Files
17 | cp -a -R $MODULEPATH/$MODULE/$DISTRIBUTION-$VERSION/.??* ~
18 |
19 | # Clear Root Permissions Mask
20 | sed -i "s/^umask o=/#umask o=/g" ~/.bashrc
21 | fi
22 |
23 | # Clean & Wipe Root Crontab
24 | if question --default yes "Do you want to clean and wipe the root crontab? (Y/n)" || [ $(read_variable_module clean_root_crontab) = 1 ]; then
25 | subheader "Cleaning Root Crontab..."
26 | echo -n "" > temp
27 | crontab -u root temp
28 | rm temp
29 | fi
30 |
--------------------------------------------------------------------------------
/modules/configure-general-user/ubuntu-1204/.bashrc:
--------------------------------------------------------------------------------
1 | [ -z "$PS1" ] && return
2 | shopt -s checkwinsize
3 |
4 | [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
5 |
6 | if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
7 | debian_chroot=$(cat /etc/debian_chroot)
8 | fi
9 |
10 | case "$TERM" in
11 | xterm-color) color_prompt=yes;;
12 | esac
13 |
14 | if [ -x /usr/bin/tput ] && tput setaf 1 > &/dev/null; then
15 | color_prompt=yes
16 | else
17 | color_prompt=
18 | fi
19 |
20 | if [ "$color_prompt" = yes ]; then
21 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
22 | else
23 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
24 | fi
25 | unset color_prompt force_color_prompt
26 |
27 | if [ -x /usr/bin/dircolors ]; then
28 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
29 | alias egrep='egrep --color=auto'
30 | alias fgrep='fgrep --color=auto'
31 | alias grep='grep --color=auto'
32 | alias ls='ls --color=auto'
33 | fi
34 |
35 | export LC_COLLATE="C"
36 | umask o=
37 |
--------------------------------------------------------------------------------
/modules/configure-general-user/ubuntu-1204/.profile:
--------------------------------------------------------------------------------
1 | if [ -f ~/.bashrc ]; then
2 | . ~/.bashrc
3 | fi
4 |
--------------------------------------------------------------------------------
/modules/configure-http-nginx/config.ini:
--------------------------------------------------------------------------------
1 | ; Configure (HTTP): Nginx Web Server
2 | ; Change options relating to the configuration of the system Nginx server.
3 | [configure_http_nginx]
4 | ; GZip Support
5 | ; Enables gzip support on plain text files (such as CSS, HTML, Javascript & XML). Compresses at level 6 for good balance between CPU usage and compression ratio. To enable set value to 1, to disable set to 0.
6 | gzip=1
7 | ; Enable Virtual Host For Hostname
8 | ; Enables a virtual host that accepts all requests for the servers hostname. Can be useful for scripts such as bandwidth monitors or web administration. To enable set value to 1, to disable set to 0.
9 | hostname_virtual_host=0
10 | ; Proxy Cache Support
11 | ; Enables proxy cache support in Nginx and creates a caching directory. Useful when using Nginx as a proxy server or when handling large loads. To enable set value to 1, to disable set to 0.
12 | proxy_cache=1
13 | ; Cache SSL Session Cache
14 | ; Enables caching of SSL sessions to improve responsiveness when using SSL. To enable set value to 1, to disable set to 0.
15 | ssl_session_cache=1
16 | ; Protect Default Host
17 | ; Overwrites current default host and denys all requests unmatched by a virtual host. To enable set value to 1, to disable set to 0.
18 | protect_default=0
19 | ; Default Host Reset
20 | ; Overwrites current default host with the default included in the script. Only has an effect when protect_default is set to 0. To enable set value to 1, to disable set to 0.
21 | default_host_reset=0
22 |
--------------------------------------------------------------------------------
/modules/configure-http-nginx/etc/sites-available/default.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80 default_server; listen [::]:80 default_server ipv6only=on;
3 | listen 443 default_server ssl; listen [::]:443 default_server ipv6only=on ssl;
4 | ssl_certificate /etc/nginx/ssl.d/self.pem; ssl_certificate_key /etc/nginx/ssl.d/self.key;
5 | return 444;
6 | }
7 |
--------------------------------------------------------------------------------
/modules/configure-http-nginx/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Configure (HTTP): Nginx
3 |
4 | # Check Package
5 | check_package_message "" "nginx" "install-http-nginx"
6 |
7 | # Enable Compression
8 | if question --default yes "Do you want to enable gzip compression to save bandwidth and decrease page load time (compresses CSS, HTML, Javascript & XML at gzip compression level 6)? (Y/n)" || [ $(read_variable_module gzip) = 1 ]; then
9 | subheader "Enabling Compression..."
10 | cp -r $MODULEPATH/install-http-nginx/etc/nginx/nginx.d/gzip.conf /etc/nginx/nginx.d/
11 | # Disable Compression
12 | else
13 | subheader "Disabling Compression..."
14 | rm /etc/nginx/nginx.d/gzip.conf &> /dev/null
15 | fi
16 |
17 | # Enable Virtual Host For Hostname
18 | if question --default yes "Do you want to enable a virtual host that accepts all requests for the servers hostname (can be useful for scripts such as bandwidth monitors)? (Y/n)" || [ $(read_variable_module hostname_virtual_host) = 1 ]; then
19 | subheader "Enabling Virtual Host For Hostname..."
20 | mv /etc/nginx/sites-available/system.conf.disabled /etc/nginx/sites-available/system.conf
21 | # Disable Virtual Host For Hostname
22 | else
23 | subheader "Disabling Virtual Host For Hostname..."
24 | mv /etc/nginx/sites-available/system.conf /etc/nginx/sites-available/system.conf.disabled
25 | fi
26 |
27 | # Enable Proxy Cache
28 | if question --default yes "Do you want to enable proxy cache support and create a cache directory? (Y/n)" || [ $(read_variable_module proxy_cache) = 1 ]; then
29 | subheader "Enabling Proxy Cache Support..."
30 | cp -r $MODULEPATH/install-http-nginx/etc/nginx/nginx.d/proxy_cache.conf /etc/nginx/nginx.d/
31 | mkdir -p /var/lib/nginx/cache
32 | chown -R www-data:www-data /var/lib/nginx/cache
33 | # Disable Proxy Cache
34 | else
35 | subheader "Disabling Proxy Cache Support..."
36 | rm /etc/nginx/nginx.d/proxy_cache.conf &> /dev/null
37 | rm -rf /var/lib/nginx/cache &> /dev/null
38 | fi
39 |
40 | # Enable SSL Session Cache
41 | if question --default yes "Do you want to enable caching of SSL sessions (can increase responsiveness over SSL)? (Y/n)" || [ $(read_variable_module ssl_session_cache) = 1 ]; then
42 | subheader "Enabling SSL Session Cache..."
43 | cp -r $MODULEPATH/install-http-nginx/etc/nginx/nginx.d/ssl_session_cache.conf /etc/nginx/nginx.d/
44 | # Disable SSL Session Cache
45 | else
46 | subheader "Disabling SSL Session Cache..."
47 | rm /etc/nginx/nginx.d/ssl_session_cache.conf &> /dev/null
48 | fi
49 |
50 | # Enable Default Host Protection
51 | if question --default no "Do you want to protect the default host by denying unmatched requests (this will override your default virtual host if you have assigned one)? (y/N)" || [ $(read_variable_module protect_default) = 1 ]; then
52 | subheader "Enabling Default Host Protection..."
53 | cp $MODULEPATH/$MODULE/etc/nginx/sites-available/default.conf /etc/nginx/sites-available/
54 | # Disable Default Host Protection
55 | else
56 | # Default Host Reset
57 | if question --default no "Do you want to reset the default host to the script default (this will override your default virtual host if you have assigned one)? (y/N)" || [ $(read_variable_module default_host_reset) = 1 ]; then
58 | subheader "Resetting Default Host..."
59 | cp $MODULEPATH/install-http-nginx/etc/nginx/sites-available/default.conf /etc/nginx/sites-available/
60 | fi
61 | fi
62 |
63 | # Restart Daemon
64 | subheader "Restarting Daemon..."
65 | daemon_manage nginx restart
66 |
--------------------------------------------------------------------------------
/modules/configure-terminal-ssh/config.ini:
--------------------------------------------------------------------------------
1 | ; Configure (Terminal): SSH Configuration
2 | ; Change SSH options such as root login support or umask privacy.
3 | [configure_terminal_ssh]
4 | ; Root SSH Login
5 | ; Enable root SSH login support. Having this option enabled is insecure as it increases the attack surface of the server. To enable set value to 1, to disable set to 0.
6 | root_login=1
7 | ; SFTP Umask Privacy
8 | ; Set a umask of 0007 on SFTP file transfers to protect files from being read by unauthorised users. To enable set value to 1, to disable set to 0.
9 | sftp_umask=1
10 |
--------------------------------------------------------------------------------
/modules/configure-terminal-ssh/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Configure (Terminal): SSH Configuration
3 |
4 | # Enable Root SSH Login
5 | if question --default yes "Do you want to enable root SSH login? (Y/n)" || [ $(read_variable_module root_login) = 1 ]; then
6 | subheader "Enabling Root SSH Login..."
7 | # Enable Root SSH Login For Dropbear
8 | if check_package "dropbear"; then
9 | sed -i 's/-w //g' /etc/default/dropbear
10 | sed -i 's/-w//g' /etc/default/dropbear
11 | fi
12 | # Enable Root SSH Login For OpenSSH
13 | if check_package "openssh-server"; then
14 | sed -i "s/PermitRootLogin no/PermitRootLogin yes/g" /etc/ssh/sshd_config
15 | adduser root ssh
16 | fi
17 | # Disable Root SSH Login
18 | else
19 | subheader "Disabling Root SSH Login..."
20 | # Disable Root SSH Login For Dropbear
21 | if check_package "dropbear"; then
22 | sed -i 's/DROPBEAR_EXTRA_ARGS="-/DROPBEAR_EXTRA_ARGS="-w -/g' /etc/default/dropbear
23 | sed -i 's/DROPBEAR_EXTRA_ARGS=""/DROPBEAR_EXTRA_ARGS="-w"/g' /etc/default/dropbear
24 | sed -i 's/-w -w/-w/g' /etc/default/dropbear
25 | fi
26 | # Disable Root SSH Login For OpenSSH
27 | if check_package "openssh-server"; then
28 | sed -i "s/PermitRootLogin yes/PermitRootLogin no/g" /etc/ssh/sshd_config
29 | deluser root ssh
30 | fi
31 | fi
32 |
33 | # Enable SFTP Umask Privacy
34 | if question --default yes "Do you want to enable private SFTP umask settings (umask 0007 on SFTP file uploads/folder creation)? (Y/n)" || [ $(read_variable_module sftp_umask) = 1 ]; then
35 | subheader "Enabling SFTP Umask Privacy..."
36 | if check_package "openssh-server"; then
37 | sed -i "s/sftp-serve.*/sftp-server -u 0007/g" /etc/ssh/sshd_config
38 | fi
39 | # Disable SFTP Umask Privacy
40 | else
41 | subheader "Disabling SFTP Umask Privacy..."
42 | if check_package "openssh-server"; then
43 | sed -i "s/sftp-serve.*/sftp-server/g" /etc/ssh/sshd_config
44 | fi
45 | fi
46 |
47 | # Check Dropbear
48 | if check_package "dropbear"; then
49 | subheader "Restarting Daemon (Dropbear)..."
50 | daemon_manage dropbear restart
51 | fi
52 |
53 | # Check SSH
54 | if check_package "openssh-server"; then
55 | subheader "Restarting Daemon (OpenSSH)..."
56 | daemon_manage ssh restart
57 | fi
58 |
--------------------------------------------------------------------------------
/modules/help-modules/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/help-modules/config.ini
--------------------------------------------------------------------------------
/modules/help-modules/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Help: Module Help & Descriptions
3 |
4 | # Print Header
5 | header "Module Name - Description"
6 |
7 | # Loop Through Modules
8 | for module in $MODULEPATH/*/init.sh; do
9 | list $module
10 | done
11 |
--------------------------------------------------------------------------------
/modules/help/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/help/config.ini
--------------------------------------------------------------------------------
/modules/help/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Help: General
3 |
4 | # Print Help
5 | cat README.md
6 |
--------------------------------------------------------------------------------
/modules/install-database-mariadb/config.ini:
--------------------------------------------------------------------------------
1 | ; Install (Database): MariaDB
2 | ; Set basic install time configuration options for the MariaDB database server.
3 | [install_database_mariadb]
4 | ; Root Password
5 | ; Set the root password to the value enclosed in the quotation marks. Be sure to check validity and that the password does not escape the quotation marks.
6 | root_password="password"
7 |
--------------------------------------------------------------------------------
/modules/install-database-mariadb/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Database): MariaDB
3 |
4 | # Repository Checks
5 | check_repository_message "" "mariadb" "MariaDB"
6 |
7 | # Package List Update Question
8 | package_update_question
9 |
10 | # Install Package
11 | subheader "Installing Package..."
12 | package_install mariadb-server
13 |
14 | # Check PHP
15 | if check_package "php5-fpm"; then
16 | subheader "Installing PHP MariaDB Package..."
17 | package_install php5-mysql
18 | fi
19 |
20 | # Set Password
21 | subheader "Setting Password..."
22 | if [ $UNATTENDED = 1 ]; then
23 | # Stop Daemon
24 | daemon_manage mysql stop
25 |
26 | # Start MariaDB Server
27 | mysqld_safe --background --skip-grant-tables
28 |
29 | # Sleep
30 | sleep 2
31 |
32 | # Set Password
33 | mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('$(read_variable_module root_password)') WHERE User='root'; FLUSH PRIVILEGES;"
34 |
35 | # Stop Daemon
36 | killall mysqld
37 |
38 | # Write User Account Configuration
39 | cat <<-EOF > /root/.my.cnf
40 | [client]
41 | user = root
42 | password = $(read_variable_module root_password)
43 | EOF
44 | fi
45 |
46 | # Start Daemon
47 | subheader "Starting Daemon..."
48 | daemon_manage mysql restart
49 |
--------------------------------------------------------------------------------
/modules/install-database-mongodb/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-database-mongodb/config.ini
--------------------------------------------------------------------------------
/modules/install-database-mongodb/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Database): MongoDB
3 |
4 | # Distribution Checks
5 | check_repository_message "" "mongodb" "MongoDB"
6 |
7 | # Package List Update Question
8 | package_update_question
9 |
10 | # Install Package
11 | subheader "Installing Package..."
12 | package_install mongodb-10gen
13 |
--------------------------------------------------------------------------------
/modules/install-database-mysql/config.ini:
--------------------------------------------------------------------------------
1 | ; Install (Database): MySQL
2 | ; Set basic install time configuration options for the MySQL database server.
3 | [install_database_mysql]
4 | ; Root Password
5 | ; Set the root password to the value enclosed in the quotation marks. Be sure to check validity and that the password does not escape the quotation marks.
6 | root_password="password"
7 |
--------------------------------------------------------------------------------
/modules/install-database-mysql/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Database): MySQL
3 |
4 | # Distribution Checks
5 | check_repository_message "debian" "dotdeb" "DotDeb"
6 |
7 | # Package List Update Question
8 | package_update_question
9 |
10 | # Install Package
11 | subheader "Installing Package..."
12 | package_install mysql-server
13 |
14 | # Check PHP
15 | if check_package "php5-fpm"; then
16 | subheader "Installing PHP MySQL Package..."
17 | package_install php5-mysql
18 | fi
19 |
20 | # Set Password
21 | subheader "Setting Password..."
22 | if [ $UNATTENDED = 1 ]; then
23 | # Stop Daemon
24 | daemon_manage mysql stop
25 |
26 | # Start MySQL Server
27 | mysqld_safe --background --skip-grant-tables
28 |
29 | # Sleep
30 | sleep 2
31 |
32 | # Set Password
33 | mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('$(read_variable_module root_password)') WHERE User='root'; FLUSH PRIVILEGES;"
34 |
35 | # Stop Daemon
36 | killall mysqld
37 |
38 | # Write User Account Configuration
39 | cat <<-EOF > /root/.my.cnf
40 | [client]
41 | user = root
42 | password = $(read_variable_module root_password)
43 | EOF
44 | fi
45 |
46 | # Start Daemon
47 | subheader "Starting Daemon..."
48 | daemon_manage mysql restart
49 |
--------------------------------------------------------------------------------
/modules/install-database-postgresql/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-database-postgresql/config.ini
--------------------------------------------------------------------------------
/modules/install-database-postgresql/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Database): PostgreSQL
3 |
4 | # Repository Checks
5 | check_repository_message "" "postgresql" "PostgreSQL"
6 |
7 | # Package List Update Question
8 | package_update_question
9 |
10 | # Install Package
11 | subheader "Installing Package..."
12 | package_install postgresql-9.1
13 |
--------------------------------------------------------------------------------
/modules/install-database-redis/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-database-redis/config.ini
--------------------------------------------------------------------------------
/modules/install-database-redis/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Database): Redis
3 |
4 | # Distribution Checks
5 | check_repository_message "debian" "dotdeb" "DotDeb"
6 |
7 | # Package List Update Question
8 | package_update_question
9 |
10 | # Install Package
11 | subheader "Installing Package..."
12 | package_install redis-server
13 |
--------------------------------------------------------------------------------
/modules/install-extra-packages/config.ini:
--------------------------------------------------------------------------------
1 | ; Install (Extra): Packages
2 | ; Defines list of packages essential to system administration to be installed after the system has been cleaned.
3 | [install_extra_packages]
4 | ; Enabled Packages
5 | ; Define a comma separated list of additional packages to install. Order matters and packages should be checked to ensure they exist in repositories.
6 | packages="axel,bwm-ng,curl,ethtool,htop,iotop,iperf,mtr-tiny,ntp,rsnapshot,rsync,screen,unrar,unzip"
7 |
--------------------------------------------------------------------------------
/modules/install-extra-packages/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Extra): Packages
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
7 | # Install Packages
8 | subheader "Installing Extra Packages..."
9 |
10 | # Define Packages
11 | PACKAGELIST=$(read_variable_module_variable packages),
12 |
13 | # Loop Through Packages
14 | while echo $PACKAGELIST | grep -q \,; do
15 | # Define Current Package
16 | PACKAGE=${PACKAGELIST%%\,*}
17 |
18 | # Remove Current Package From List
19 | PACKAGELIST=${PACKAGELIST#*\,}
20 |
21 | # Install Currently Selected Package
22 | package_install $PACKAGE
23 | done
24 |
25 | # Unset Array
26 | unset PACKAGELIST
27 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/config.ini:
--------------------------------------------------------------------------------
1 | ; Install (Extra): Repositories
2 | ; Define a list of repositories to be installed and the default mirrors for the base repositories.
3 | [install_extra_repositories]
4 | ; Enabled Repositories
5 | ; Define a comma separated list of repositories to enable. Order matters and repositories should be comma separated.
6 | repositories_debian_6="default"
7 | repositories_debian_7="default"
8 | repositories_ubuntu_1204="default"
9 | ; System Mirror
10 | ; The default mirror used by the system repository. Used when the "default" repository is added to the repositories list.
11 | mirror_debian_6="http://ftp.us.debian.org/debian/"
12 | mirror_debian_7="http://ftp.us.debian.org/debian/"
13 | mirror_ubuntu_1204="http://us.archive.ubuntu.com/ubuntu/"
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-6/debian-multimedia.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Debian Multimedia Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Debian Multimedia repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Debian Multimedia Repository..."
7 |
8 | # Add Repository
9 | repo_add "debian-multimedia" "deb http://www.deb-multimedia.org/ squeeze main non-free"
10 |
11 | # Update Package Lists
12 | package_update
13 |
14 | # Install Repository Key
15 | apt-get -qy --allow-unauthenticated install deb-multimedia-keyring
16 |
17 | # Add Package To Package List
18 | echo "deb-multimedia-keyring" >> $MODULEPATH/clean-packages/custom/custom
19 | fi
20 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-6/default.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Optimise Default Repositories
3 |
4 | # Ask If Repositories Should Be Optimised
5 | if question --default yes "Do you want to optimise the default repositories? Warning, this replaces the default repository list! (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Optimising Default Repositories..."
7 |
8 | # Check Mirror
9 | if [ $(read_variable_module_variable mirror_$DISTRIBUTION_$VERSION) = 0 ]; then
10 | # Set Mirror
11 | MIRROR="http://ftp.us.debian.org/debian/"
12 | else
13 | # Set Mirror
14 | MIRROR=$(read_variable_module_variable mirror_$DISTRIBUTION_$VERSION)
15 | fi
16 |
17 | # Update Squeeze Repository
18 | echo "deb $MIRROR squeeze main contrib non-free" > /etc/apt/sources.list
19 |
20 | # Update Squeeze Updates Repository
21 | echo "deb $MIRROR squeeze-updates main contrib non-free" >> /etc/apt/sources.list
22 |
23 | # Update Squeeze Security Repository
24 | echo "deb http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
25 | fi
26 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-6/dotdeb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install DotDeb Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the DotDeb repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing DotDeb Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "http://www.dotdeb.org/dotdeb.gpg"
10 |
11 | # Add Repository
12 | repo_add "dotdeb" "deb http://packages.dotdeb.org/ squeeze all\ndeb http://packages.dotdeb.org/ squeeze-php54 all"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-6/mariadb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install MariaDB Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the MariaDB repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing MariaDB Repository..."
7 |
8 | # Add Repository Key
9 | repo_key_server "keyserver.ubuntu.com" "0xcbcb082a1bb943db"
10 |
11 | # Add Repository
12 | repo_add "mariadb" "deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/debian/ squeeze main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-6/mongodb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install MongoDB Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the MongoDB repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing MongoDB Repository..."
7 |
8 | # Add Repository Key
9 | repo_key_server "keyserver.ubuntu.com" "7F0CEB10"
10 |
11 | # Add Repository
12 | repo_add "mongodb" "deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-6/nginx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Nginx Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Nginx repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Nginx Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "http://nginx.org/keys/nginx_signing.key"
10 |
11 | # Add Repository
12 | repo_add "nginx" "deb http://nginx.org/packages/debian/ squeeze nginx"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-6/plex.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Plex Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Plex repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Plex Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "http://shell.ninthgate.se/packages/shell-ninthgate-se-keyring.key"
10 |
11 | # Add Repository
12 | repo_add "plex" "deb http://shell.ninthgate.se/packages/debian squeeze main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-6/postgresql.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install PostgreSQL Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the PostgreSQL repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing PostgreSQL Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "http://www.postgresql.org/media/keys/ACCC4CF8.asc"
10 |
11 | # Add Repository
12 | repo_add "postgresql" "deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-6/proxmox.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Proxmox Repository
3 |
4 | # Check Architecture
5 | if [ $ARCHITECTURE = "x64" ]; then
6 | # Ask If Repository Should Be Installed
7 | if question --default yes "Do you want to install the Proxmox repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
8 | subheader "Installing Proxmox Repository..."
9 |
10 | # Add Repository Key
11 | repo_key "http://download.proxmox.com/debian/key.asc"
12 |
13 | # Add Repository
14 | repo_add "proxmox" "deb http://download.proxmox.com/debian/ squeeze pve"
15 | fi
16 | fi
17 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-6/webupd8-java.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install WebUpd8 Java Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the WebUpd8 Java repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing WebUpd8 Java Repository..."
7 |
8 | # Add Repository Key
9 | repo_key_server "keyserver.ubuntu.com" "EEA14886"
10 |
11 | # Add Repository
12 | repo_add "webupd8-java" "deb http://ppa.launchpad.net/webupd8team/java/ubuntu/ precise main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/debian-multimedia.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Debian Multimedia Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Debian Multimedia repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Debian Multimedia Repository..."
7 |
8 | # Add Repository
9 | repo_add "debian-multimedia" "deb http://www.deb-multimedia.org/ wheezy main non-free"
10 |
11 | # Update Package Lists
12 | package_update
13 |
14 | # Install Repository Key
15 | apt-get -qy --allow-unauthenticated install deb-multimedia-keyring
16 |
17 | # Add Package To Package List
18 | echo "deb-multimedia-keyring" >> $MODULEPATH/clean-packages/custom/custom
19 | fi
20 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/default.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Optimise Default Repositories
3 |
4 | # Ask If Repositories Should Be Optimised
5 | if question --default yes "Do you want to optimise the default repositories? Warning, this replaces the default repository list! (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Optimising Default Repositories..."
7 |
8 | # Check Mirror
9 | if [ $(read_variable_module_variable mirror_$DISTRIBUTION_$VERSION) = 0 ]; then
10 | # Set Mirror
11 | MIRROR="http://ftp.us.debian.org/debian/"
12 | else
13 | # Set Mirror
14 | MIRROR=$(read_variable_module_variable mirror_$DISTRIBUTION_$VERSION)
15 | fi
16 |
17 | # Update Squeeze Repository
18 | echo "deb $MIRROR wheezy main contrib non-free" > /etc/apt/sources.list
19 |
20 | # Update Squeeze Security Repository
21 | echo "deb http://security.debian.org/ wheezy/updates main contrib non-free" >> /etc/apt/sources.list
22 | fi
23 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/dotdeb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install DotDeb Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the DotDeb repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing DotDeb Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "http://www.dotdeb.org/dotdeb.gpg"
10 |
11 | # Add Repository
12 | repo_add "dotdeb" "deb http://packages.dotdeb.org/ squeeze all\ndeb http://packages.dotdeb.org wheezy-php55 all"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/mariadb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install MariaDB Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the MariaDB repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing MariaDB Repository..."
7 |
8 | # Add Repository Key
9 | repo_key_server "keyserver.ubuntu.com" "0xcbcb082a1bb943db"
10 |
11 | # Add Repository
12 | repo_add "mariadb" "deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/debian/ wheezy main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/mongodb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install MongoDB Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the MongoDB repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing MongoDB Repository..."
7 |
8 | # Add Repository Key
9 | repo_key_server "keyserver.ubuntu.com" "7F0CEB10"
10 |
11 | # Add Repository
12 | repo_add "mongodb" "deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/nginx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Nginx Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Nginx repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Nginx Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "http://nginx.org/keys/nginx_signing.key"
10 |
11 | # Add Repository
12 | repo_add "nginx" "deb http://nginx.org/packages/debian/ wheezy nginx"
13 | fi
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/nodejs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Node.js Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Node repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Node.js Repository..."
7 |
8 | # Update Packages
9 | package_update
10 |
11 | # Install HTTPS Transport
12 | package_install "apt-transport-https"
13 |
14 | # Add Repository Key
15 | repo_key "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
16 |
17 | # Add Repository
18 | repo_add "nodejs" "deb https://deb.nodesource.com/node wheezy main"
19 |
20 | # Add HTTPS Transport To Package List
21 | echo "apt-transport-https" >> $MODULEPATH/clean-packages/custom/custom
22 | fi
23 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/plex.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Plex Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Plex repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Plex Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "http://shell.ninthgate.se/packages/shell-ninthgate-se-keyring.key"
10 |
11 | # Add Repository
12 | repo_add "plex" "deb http://shell.ninthgate.se/packages/debian wheezy main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/postgresql.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install PostgreSQL Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the PostgreSQL repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing PostgreSQL Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "http://www.postgresql.org/media/keys/ACCC4CF8.asc"
10 |
11 | # Add Repository
12 | repo_add "postgresql" "deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/proxmox.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Proxmox Repository
3 |
4 | # Check Architecture
5 | if [ $ARCHITECTURE = "x64" ]; then
6 | # Ask If Repository Should Be Installed
7 | if question --default yes "Do you want to install the Proxmox repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
8 | subheader "Installing Proxmox Repository..."
9 |
10 | # Add Repository Key
11 | repo_key "http://download.proxmox.com/debian/key.asc"
12 |
13 | # Add Repository
14 | repo_add "proxmox" "deb http://download.proxmox.com/debian/ wheezy pve"
15 | fi
16 | fi
17 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/debian-7/webupd8-java.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install WebUpd8 Java Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the WebUpd8 Java repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing WebUpd8 Java Repository..."
7 |
8 | # Add Repository Key
9 | repo_key_server "keyserver.ubuntu.com" "EEA14886"
10 |
11 | # Add Repository
12 | repo_add "webupd8-java" "deb http://ppa.launchpad.net/webupd8team/java/ubuntu/ precise main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Extra): Repositories
3 |
4 | # Install Repositories
5 | subheader "Installing Extra Repositories..."
6 |
7 | # Attended Mode
8 | if [ $UNATTENDED = 0 ]; then
9 | # Loop Through Available Repositories
10 | for file in $MODULEPATH/$MODULE/$DISTRIBUTION-$VERSION/*.sh; do
11 | # Source Scripts
12 | source $file
13 | done
14 | # Unattended Mode
15 | else
16 | # Define Repositories
17 | REPOLIST=$(read_variable_module repositories_$DISTRIBUTION_$VERSION),
18 |
19 | # Loop Through Repositories
20 | while echo $REPOLIST | grep -q \,; do
21 | # Define Current Package
22 | FILE=${REPOLIST%%\,*}
23 |
24 | # Remove Current Package From List
25 | REPOLIST=${REPOLIST#*\,}
26 |
27 | # Source Scripts
28 | source $MODULEPATH/$MODULE/$DISTRIBUTION-$VERSION/$FILE.sh
29 | done
30 | fi
31 |
32 | # Unset Array
33 | unset REPOLIST
34 |
35 | # Update Package Lists
36 | package_update
37 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/ubuntu-1204/default.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Optimise Default Repositories
3 |
4 | # Ask If Repositories Should Be Optimised
5 | if question --default yes "Do you want to optimise the default repositories? Warning, this replaces the default repository list! (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Optimising Default Repositories..."
7 |
8 | # Check Mirror
9 | if [ $(read_variable_module_variable mirror_$DISTRIBUTION_$VERSION) = 0 ]; then
10 | # Set Mirror
11 | MIRROR="http://us.archive.ubuntu.com/ubuntu/"
12 | else
13 | # Set Mirror
14 | MIRROR=$(read_variable_module_variable mirror_$DISTRIBUTION_$VERSION)
15 | fi
16 |
17 | # Update Precise Repository
18 | echo "deb $MIRROR precise main restricted universe multiverse" > /etc/apt/sources.list
19 |
20 | # Update Precise Updates Repository
21 | echo "deb $MIRROR precise-updates main restricted universe multiverse" >> /etc/apt/sources.list
22 |
23 | # Update Precise Security Repository
24 | echo "deb $MIRROR precise-security main restricted universe multiverse" >> /etc/apt/sources.list
25 | fi
26 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/ubuntu-1204/mariadb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install MariaDB Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the MariaDB repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing MariaDB Repository..."
7 |
8 | # Add Repository Key
9 | repo_key_server "keyserver.ubuntu.com" "0xcbcb082a1bb943db"
10 |
11 | # Add Repository
12 | repo_add "mariadb" "deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu/ precise main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/ubuntu-1204/medibuntu.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Medibuntu Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Medibuntu repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Medibuntu Repository..."
7 |
8 | # Add Repository
9 | repo_add "medibuntu" "deb http://packages.medibuntu.org/ precise free non-rfee"
10 |
11 | # Update Package Lists
12 | package_update
13 |
14 | # Install Repository Key
15 | apt-get -qy --allow-unauthenticated install medibuntu-keyring
16 |
17 | # Add Package To Package List
18 | echo "medibuntu-keyring" >> $MODULEPATH/clean-packages/custom/custom
19 | fi
20 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/ubuntu-1204/mongodb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install MongoDB Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the MongoDB repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing MongoDB Repository..."
7 |
8 | # Add Repository Key
9 | repo_key_server "keyserver.ubuntu.com" "7F0CEB10"
10 |
11 | # Add Repository
12 | repo_add "mongodb" "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/ubuntu-1204/nginx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Nginx Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Nginx repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Nginx Repository..."
7 |
8 | # Add Repository Key
9 | repo_key_server "keyserver.ubuntu.com" "C300EE8C"
10 |
11 | # Add Repository
12 | repo_add "nginx" "deb http://ppa.launchpad.net/nginx/stable/ubuntu precise main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/ubuntu-1204/nodejs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Node.js Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Node repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Node.js Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
10 |
11 | # Add Repository
12 | repo_add "nodejs" "deb https://deb.nodesource.com/node precise main"
13 |
14 | # Install HTTPS Transport
15 | package_install "apt-transport-https"
16 |
17 | # Add HTTPS Transport To Package List
18 | echo "apt-transport-https" >> $MODULEPATH/clean-packages/custom/custom
19 | fi
20 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/ubuntu-1204/plex.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install Plex Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the Plex repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing Plex Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "http://www.plexapp.com/plex_pub_key.pub"
10 |
11 | # Add Repository
12 | repo_add "plex" "deb http://www.plexapp.com/repo lucid main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/ubuntu-1204/postgresql.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install PostgreSQL Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the PostgreSQL repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing PostgreSQL Repository..."
7 |
8 | # Add Repository Key
9 | repo_key "http://www.postgresql.org/media/keys/ACCC4CF8.asc"
10 |
11 | # Add Repository
12 | repo_add "postgresql" "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-extra-repositories/ubuntu-1204/webupd8-java.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install WebUpd8 Java Repository
3 |
4 | # Ask If Repository Should Be Installed
5 | if question --default yes "Do you want to install the WebUpd8 Java repository? (Y/n)" || [ $UNATTENDED = 1 ]; then
6 | subheader "Installing WebUpd8 Java Repository..."
7 |
8 | # Add Repository Key
9 | repo_key_server "keyserver.ubuntu.com" "EEA14886"
10 |
11 | # Add Repository
12 | repo_add "webupd8-java" "deb http://ppa.launchpad.net/webupd8team/java/ubuntu/ precise main"
13 | fi
14 |
--------------------------------------------------------------------------------
/modules/install-framework-node/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-framework-node/config.ini
--------------------------------------------------------------------------------
/modules/install-framework-node/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Framework): NodeJS
3 |
4 | # Repository Checks
5 | check_repository_message "" "nodejs" "NodeJS"
6 |
7 | # Package List Update Question
8 | package_update_question
9 |
10 | # Install Package
11 | subheader "Installing Package..."
12 | package_install nodejs
13 |
--------------------------------------------------------------------------------
/modules/install-framework-php/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-framework-php/config.ini
--------------------------------------------------------------------------------
/modules/install-framework-php/etc/php5/fpm/pool.d/www-data.conf:
--------------------------------------------------------------------------------
1 | [www-data]
2 | listen = /dev/shm/php.socket
3 | user = www-data
4 | group = www-data
5 | pm = ondemand
6 | pm.max_children = 4
7 | pm.max_requests = 500
8 | php_flag[expose_php] = off
9 | php_value[max_execution_time] = 120
10 | php_value[memory_limit] = 64M
11 |
--------------------------------------------------------------------------------
/modules/install-framework-php/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Framework): PHP
3 |
4 | # Distribution Checks
5 | check_repository_message "debian" "dotdeb" "DotDeb"
6 |
7 | # Package List Update Question
8 | package_update_question
9 |
10 | # Install Package
11 | subheader "Installing Package..."
12 | package_install php5-cli php5-fpm
13 |
14 | # Install Extras
15 | subheader "Installing Extras..."
16 | package_install php5-curl php5-gd php5-mcrypt php5-sqlite
17 |
18 | # Check MariaDB/MySQL
19 | if check_package "mariadb-server" || check_package "mysql-server"; then
20 | subheader "Installing PHP MySQL Package..."
21 | package_install php5-mysql
22 | fi
23 |
24 | # Check PostgreSQL
25 | if check_package "postgresql-9.1"; then
26 | subheader "Installing PHP PostgreSQL Package..."
27 | package_install php5-pgsql
28 | fi
29 |
30 | # Copy Configuration
31 | subheader "Copying Configuration..."
32 | cp -r $MODULEPATH/$MODULE/etc/* /etc/
33 |
34 | # Common Clean
35 | common-clean
36 |
37 | # Restart Daemon
38 | subheader "Restarting Daemon..."
39 | daemon_manage php5-fpm restart
40 |
--------------------------------------------------------------------------------
/modules/install-framework-python/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-framework-python/config.ini
--------------------------------------------------------------------------------
/modules/install-framework-python/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Framework): Python
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
7 | # Install Package
8 | subheader "Installing Python..."
9 | package_install python python-pip
10 |
--------------------------------------------------------------------------------
/modules/install-framework-ruby/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-framework-ruby/config.ini
--------------------------------------------------------------------------------
/modules/install-framework-ruby/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Framework): Ruby
3 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-http-nginx/config.ini
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/conf.d/cache.conf:
--------------------------------------------------------------------------------
1 | location ~ \.(gif|jpeg|jpg|png)$ {
2 | access_log off;
3 | expires 30d;
4 | }
5 |
6 | location ~ \.(css|ico|js|xml)$ {
7 | access_log off;
8 | expires 30d;
9 | }
10 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/conf.d/deny.conf:
--------------------------------------------------------------------------------
1 | location ~ /\. {
2 | deny all;
3 | }
4 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/custom.d/default.conf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-http-nginx/etc/nginx/custom.d/default.conf
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/custom.d/system.conf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-http-nginx/etc/nginx/custom.d/system.conf
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/fastcgi_params:
--------------------------------------------------------------------------------
1 | fastcgi_buffer_size 32k;
2 | fastcgi_buffers 8 16k;
3 | fastcgi_param CONTENT_LENGTH $content_length;
4 | fastcgi_param CONTENT_TYPE $content_type;
5 | fastcgi_param DOCUMENT_ROOT $document_root;
6 | fastcgi_param DOCUMENT_URI $document_uri;
7 | fastcgi_param GATEWAY_INTERFACE CGI/1.1;
8 | fastcgi_param HTTPS $https;
9 | fastcgi_param QUERY_STRING $query_string;
10 | fastcgi_param REDIRECT_STATUS 200;
11 | fastcgi_param REMOTE_ADDR $remote_addr;
12 | fastcgi_param REMOTE_PORT $remote_port;
13 | fastcgi_param REQUEST_METHOD $request_method;
14 | fastcgi_param REQUEST_URI $request_uri;
15 | fastcgi_param SCRIPT_FILENAME $request_filename;
16 | fastcgi_param SCRIPT_NAME $fastcgi_script_name;
17 | fastcgi_param SERVER_ADDR $server_addr;
18 | fastcgi_param SERVER_NAME $server_name;
19 | fastcgi_param SERVER_PORT $server_port;
20 | fastcgi_param SERVER_PROTOCOL $server_protocol;
21 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
22 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/nginx.conf:
--------------------------------------------------------------------------------
1 | user www-data;
2 | pid /var/run/nginx.pid;
3 |
4 | events {
5 | multi_accept on;
6 | worker_connections 1024;
7 | }
8 |
9 | http {
10 | access_log off;
11 | default_type application/octet-stream;
12 | server_names_hash_bucket_size 128;
13 | server_tokens off;
14 |
15 | include /etc/nginx/nginx.d/*.conf;
16 | include /etc/nginx/sites-enabled/*.conf;
17 | }
18 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/nginx.d/gzip.conf:
--------------------------------------------------------------------------------
1 | gzip on;
2 | gzip_proxied any;
3 | gzip_types application/x-javascript application/xml text/css text/javascript text/plain text/xml;
4 | gzip_vary on;
5 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/nginx.d/proxy_cache.conf:
--------------------------------------------------------------------------------
1 | proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g;
2 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/nginx.d/ssl_session_cache.conf:
--------------------------------------------------------------------------------
1 | ssl_session_cache shared:SSL:10m;
2 | ssl_session_timeout 10m;
3 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/php.d/www-data.conf:
--------------------------------------------------------------------------------
1 | location ~ \.php$ {
2 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
3 | fastcgi_pass unix:/dev/shm/php.socket;
4 | include fastcgi_params;
5 | try_files $uri =404;
6 | }
7 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/sites-available/default.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80 default_server; listen [::]:80 default_server ipv6only=on;
3 | listen 443 default_server ssl; listen [::]:443 default_server ipv6only=on ssl;
4 | server_name _;
5 | ssl_certificate /etc/nginx/ssl.d/self.pem; ssl_certificate_key /etc/nginx/ssl.d/self.key;
6 |
7 | access_log off;
8 | error_log /var/log/nginx/default.log;
9 | index index.html index.php;
10 | root path;
11 |
12 | include /etc/nginx/conf.d/cache.conf;
13 | include /etc/nginx/conf.d/deny.conf;
14 | include /etc/nginx/custom.d/default.conf;
15 | include /etc/nginx/php.d/www-data.conf;
16 | }
17 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/sites-available/system.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80; listen [::]:80;
3 | listen 443 ssl; listen [::]:443 ssl;
4 | server_name $hostname;
5 | ssl_certificate /etc/nginx/ssl.d/self.pem; ssl_certificate_key /etc/nginx/ssl.d/self.key;
6 |
7 | access_log off;
8 | error_log /var/log/nginx/system.log;
9 | index index.html index.php;
10 | root path;
11 |
12 | include /etc/nginx/conf.d/cache.conf;
13 | include /etc/nginx/conf.d/deny.conf;
14 | include /etc/nginx/custom.d/system.conf;
15 | include /etc/nginx/php.d/www-data.conf;
16 | }
17 |
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/ssl.d/self.key:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-http-nginx/etc/nginx/ssl.d/self.key
--------------------------------------------------------------------------------
/modules/install-http-nginx/etc/nginx/ssl.d/self.pem:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-http-nginx/etc/nginx/ssl.d/self.pem
--------------------------------------------------------------------------------
/modules/install-http-nginx/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (HTTP): Nginx
3 |
4 | # Distribution Checks
5 | check_repository_message "debian" "dotdeb" "DotDeb"
6 | check_repository_message "ubuntu" "nginx"
7 |
8 | # Package List Update Question
9 | package_update_question
10 |
11 | # Check OpenSSL
12 | if ! check_package "openssl;"; then
13 | subheader "Installing OpenSSL..."
14 | package_install openssl
15 | fi
16 |
17 | # Install Package
18 | subheader "Installing Package..."
19 | package_install nginx
20 |
21 | # Copy Configuration
22 | subheader "Copying Configuration..."
23 | cp -rf $MODULEPATH/$MODULE/etc/* /etc/
24 |
25 | # Create Caching Directory
26 | subheader "Creating Caching Directory..."
27 | mkdir -p /var/lib/nginx/cache
28 | chown -R www-data:www-data /var/lib/nginx/cache
29 | chmod -R o= /var/lib/nginx/cache
30 |
31 | # Create Self Signed SSL Certificate
32 | subheader "Creating Self Signed SSL Certificate..."
33 | openssl req -new -days 3650 -newkey rsa:2048 -nodes -x509 -subj "/C=/ST=/L=/O=/CN=$(hostname -f)" -out /etc/nginx/ssl.d/self.pem -keyout /etc/nginx/ssl.d/self.key
34 | chown -R www-data:www-data /etc/nginx/ssl.d
35 | chmod -R o= /etc/nginx/ssl.d
36 |
37 | # Set Distribution Specific Variables
38 | if [ $DISTRIBUTION = "debian" ]; then
39 | string_replace_file /etc/nginx/sites-available/default.conf "root path" "root /usr/share/nginx/html"
40 | string_replace_file /etc/nginx/sites-available/system.conf "root path" "root /usr/share/nginx/html"
41 | elif [ $DISTRIBUTION = "ubuntu" ]; then
42 | string_replace_file /etc/nginx/sites-available/default.conf "root path" "root /usr/share/nginx/www"
43 | string_replace_file /etc/nginx/sites-available/system.conf "root path" "root /usr/share/nginx/www"
44 | fi
45 |
46 | # Common Clean
47 | common-clean
48 |
49 | # Restart Daemon
50 | subheader "Restarting Daemon..."
51 | daemon_manage nginx restart
52 |
--------------------------------------------------------------------------------
/modules/install-mail-exim/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-mail-exim/config.ini
--------------------------------------------------------------------------------
/modules/install-mail-exim/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Mail): Exim
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
7 | # Install Package
8 | subheader "Installing Package..."
9 | package_install exim4
10 |
11 | # Change Configuration
12 | subheader "Enabling Internet Mail Configuration..."
13 | sed -i "s/dc_eximconfig_configtype='local'/dc_eximconfig_configtype='internet'/" /etc/exim4/update-exim4.conf.conf
14 |
15 | # Restart Daemon
16 | subheader "Restarting Daemon..."
17 | daemon_manage exim4 restart
18 |
--------------------------------------------------------------------------------
/modules/install-network-dnsmasq/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-network-dnsmasq/config.ini
--------------------------------------------------------------------------------
/modules/install-network-dnsmasq/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Network): DNSMasq
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
--------------------------------------------------------------------------------
/modules/install-network-openvpn/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-network-openvpn/config.ini
--------------------------------------------------------------------------------
/modules/install-network-openvpn/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Network): OpenVPN
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
--------------------------------------------------------------------------------
/modules/install-network-pptp/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-network-pptp/config.ini
--------------------------------------------------------------------------------
/modules/install-network-pptp/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Network): PPTP
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
--------------------------------------------------------------------------------
/modules/install-network-softether/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-network-softether/config.ini
--------------------------------------------------------------------------------
/modules/install-network-softether/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Network): SoftEther
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
--------------------------------------------------------------------------------
/modules/install-security-fail2ban/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-security-fail2ban/config.ini
--------------------------------------------------------------------------------
/modules/install-security-fail2ban/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Security): Fail2Ban
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
7 | # Install Package
8 | subheader "Installing Package..."
9 | package_install fail2ban
10 |
--------------------------------------------------------------------------------
/modules/install-security-logwatch/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-security-logwatch/config.ini
--------------------------------------------------------------------------------
/modules/install-security-logwatch/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Security): LogWatch
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
7 | # Install Package
8 | subheader "Installing Package..."
9 | package_install logwatch
10 |
--------------------------------------------------------------------------------
/modules/install-security-sudo/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-security-sudo/config.ini
--------------------------------------------------------------------------------
/modules/install-security-sudo/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Security): SUDO
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
7 | # Install Package
8 | subheader "Installing Package..."
9 | package_install sudo
10 |
--------------------------------------------------------------------------------
/modules/install-security-unattended-upgrades/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-security-unattended-upgrades/config.ini
--------------------------------------------------------------------------------
/modules/install-security-unattended-upgrades/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Security): Unattended Upgrades
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
7 | # Install Package
8 | subheader "Installing Package..."
9 | package_install unattended-upgrades
10 |
--------------------------------------------------------------------------------
/modules/install-terminal-openssh/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-terminal-openssh/config.ini
--------------------------------------------------------------------------------
/modules/install-terminal-openssh/etc/ssh/ssh_config:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-terminal-openssh/etc/ssh/ssh_config
--------------------------------------------------------------------------------
/modules/install-terminal-openssh/etc/ssh/sshd_config:
--------------------------------------------------------------------------------
1 | AllowGroups sftp ssh
2 | PermitRootLogin no
3 | UsePAM yes
4 |
5 | ChallengeResponseAuthentication no
6 | Port 22
7 | Protocol 2
8 | Subsystem sftp /usr/lib/openssh/sftp-server -u 0007
9 |
10 | Match Group sftp
11 | AllowTcpForwarding no
12 | ChrootDirectory /home/%u
13 | ForceCommand internal-sftp
14 |
--------------------------------------------------------------------------------
/modules/install-terminal-openssh/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Terminal): OpenSSH Server
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
7 | # Install Package
8 | subheader "Installing Package..."
9 | package_install openssh-server
10 |
11 | # Copy Configuration
12 | subheader "Copying Configuration..."
13 | cp -r $MODULEPATH/$MODULE/etc/* /etc/
14 |
15 | # Creating Groups
16 | addgroup sftp
17 | addgroup ssh
18 |
19 | # Restart Daemon
20 | subheader "Restarting Daemon..."
21 | daemon_manage ssh restart
22 |
--------------------------------------------------------------------------------
/modules/install-torrent-deluge/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-torrent-deluge/config.ini
--------------------------------------------------------------------------------
/modules/install-torrent-deluge/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Torrent): Deluge
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
--------------------------------------------------------------------------------
/modules/install-torrent-rtorrent/config.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KnightSwarm/Minstall/db204fa6b27a9b621a698d68204413988666e875/modules/install-torrent-rtorrent/config.ini
--------------------------------------------------------------------------------
/modules/install-torrent-rtorrent/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Install (Torrent): rTorrent
3 |
4 | # Package List Update Question
5 | package_update_question
6 |
--------------------------------------------------------------------------------
/modules/manage-user-add/config.ini:
--------------------------------------------------------------------------------
1 | ; Manage: User Add
2 | [manage_user_add]
3 | ; Usernames (Comma Separated)
4 | user="main"
5 | ; Passwords (Comma Separated)
6 | pass="password"
7 | ; HTTP Directory Setup? (Comma Separated, Accepted Values: 0 1)
8 | http="0"
9 | ; Set User Folder Permissions? (Comma Separated, Accepted Values: 0 1)
10 | perm="1"
11 | ; Allow User SSH Access? (Comma Separated, Accepted Values: 0 1)
12 | ssh="1"
13 | ; Allow User SFTP Access? (Comma Separated, Accepted Values: 0 1)
14 | sftp="1"
15 |
--------------------------------------------------------------------------------
/modules/manage-user-add/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Manage: User Add
3 |
4 | # Manage User
5 | manage-user
6 |
7 | # Module Function
8 | module() {
9 | # Add User
10 | manage-user-manage-add $USER
11 |
12 | # Check User
13 | manage-user-check-user $USER
14 |
15 | # Check Variable Set State
16 | if [[ -z "$PASS" ]]; then
17 | # Set Password
18 | manage-user-set-password $USER
19 | else
20 | # Set Password
21 | manage-user-set-password $USER $PASS
22 | fi
23 |
24 | # Clean Cron Entry
25 | manage-user-clean-cron $USER
26 |
27 | # Check Package
28 | if check_package "nginx"; then
29 | # User HTTP Directory Question
30 | if question --default yes "Do you want to add a HTTP directory for this user? (Y/n)" || [ $HTTP = 1 ]; then
31 | manage-user-http-directory $USER
32 | fi
33 | fi
34 |
35 | # User Set Permissions Question
36 | if question --default yes "Do you want to set permissions for this user to enable enhanced privacy? (Y/n)" || [ $PERM = 1 ]; then
37 | manage-user-set-permissions $USER
38 | fi
39 |
40 | # User Add to SSH Question
41 | if question --default yes "Do you want to allow this user access to SSH? (Y/n)" || [ $SSH = 1 ]; then
42 | manage-user-add-group $USER "ssh"
43 | else
44 | manage-user-remove-group $USER "ssh"
45 |
46 | if question --default yes "Do you want to allow this user access to SFTP? (Y/n)" || [ $SFTP = 1 ]; then
47 | manage-user-add-group $USER "sftp"
48 | else
49 | manage-user-remove-group $USER "sftp"
50 | fi
51 | fi
52 |
53 | # Check Package
54 | if check_package "sudo"; then
55 | # User Add to sudoers Question
56 | if question --default no "Do you want to allow this user access to sudo? (y/N)" || [ $SUDO = 1 ]; then
57 | manage-user-add-group $USER "sudo"
58 | else
59 | manage-user-remove-group $USER "sudo"
60 | fi
61 | fi
62 | }
63 |
64 | # Attended Mode
65 | if [ $UNATTENDED = 0 ]; then
66 | # User Input
67 | manage-user-input-user
68 |
69 | # Module Function
70 | module
71 | # Unattended Mode
72 | else
73 | # Define Arrays
74 | USERLIST=$(read_variable_module user),
75 | PASSLIST=$(read_variable_module pass),
76 | HTTPLIST=$(read_variable_module http),
77 | PERMLIST=$(read_variable_module perm),
78 | SSHLIST=$(read_variable_module ssh),
79 | SFTPLIST=$(read_variable_module sftp),
80 |
81 | # Loop Through Users
82 | while echo $USERLIST | grep -q \,; do
83 | # Define Variables
84 | USER=${USERLIST%%\,*}
85 | PASS=${PASSLIST%%\,*}
86 | HTTP=${HTTPLIST%%\,*}
87 | PERM=${PERMLIST%%\,*}
88 | SSH=${SSHLIST%%\,*}
89 | SFTP=${SFTPLIST%%\,*}
90 |
91 | # Remove Current From List
92 | USERLIST=${USERLIST#*\,}
93 | PASSLIST=${PASSLIST#*\,}
94 | HTTPLIST=${HTTPLIST#*\,}
95 | PERMLIST=${PERMLIST#*\,}
96 | SSHLIST=${SSHLIST#*\,}
97 | SFTPLIST=${SFTPLIST#*\,}
98 |
99 | # Check User Array State
100 | manage-user-check-array $USERLIST
101 |
102 | # Module Function
103 | module
104 | done
105 |
106 | # Unset Arrays
107 | unset USERLIST
108 | unset PASSLIST
109 | unset HTTPLIST
110 | unset PERMLIST
111 | unset SSHLIST
112 | unset SFTPLIST
113 |
114 | # Unset Variables
115 | unset USER
116 | unset PASS
117 | unset HTTP
118 | unset PERM
119 | unset SSH
120 | unset SFTP
121 | fi
122 |
123 | # Unset Init
124 | unset -f init
125 |
--------------------------------------------------------------------------------
/modules/manage-user-manage/config.ini:
--------------------------------------------------------------------------------
1 | ; Manage: User Manage
2 | [manage_user_manage]
3 | ; Usernames (Comma Separated)
4 | user="main"
5 | ; Passwords (Comma Separated, 0 = No Change)
6 | pass="password"
7 | ; HTTP Directory Setup? (Comma Separated, Accepted Values: 0 1)
8 | http="0"
9 | ; Set User Folder Permissions? (Comma Separated, Accepted Values: 0 1)
10 | perm="1"
11 | ; Allow User SSH Access? (Comma Separated, Accepted Values: 0 1)
12 | ssh="1"
13 | ; Allow User SFTP Access? (Comma Separated, Accepted Values: 0 1)
14 | sftp="1"
15 |
--------------------------------------------------------------------------------
/modules/manage-user-manage/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Manage: User Manage
3 |
4 | # Manage User
5 | manage-user
6 |
7 | # Module Function
8 | module() {
9 | # Check User
10 | manage-user-check-user $USER
11 |
12 | # Check Variable Set State
13 | if [[ -z "$PASS" ]]; then
14 | # Set Password
15 | manage-user-set-password $USER
16 | else
17 | # Set Password
18 | manage-user-set-password $USER $PASS
19 | fi
20 |
21 | # Clean Cron Entry
22 | manage-user-clean-cron $USER
23 |
24 | # Check Package
25 | if check_package "nginx"; then
26 | # User HTTP Directory Question
27 | if question --default yes "Do you want to add a HTTP directory for this user? (Y/n)" || [ $HTTP = 1 ]; then
28 | manage-user-http-directory $USER
29 | fi
30 | fi
31 |
32 | # User Set Permissions Question
33 | if question --default yes "Do you want to set permissions for this user to enable enhanced privacy? (Y/n)" || [ $PERM = 1 ]; then
34 | manage-user-set-permissions $USER
35 | fi
36 |
37 | # User Add to SSH Question
38 | if question --default yes "Do you want to allow this user access to SSH? (Y/n)" || [ $SSH = 1 ]; then
39 | manage-user-add-group $USER "ssh"
40 | else
41 | manage-user-remove-group $USER "ssh"
42 |
43 | if question --default yes "Do you want to allow this user access to SFTP? (Y/n)" || [ $SFTP = 1 ]; then
44 | manage-user-add-group $USER "sftp"
45 | else
46 | manage-user-remove-group $USER "sftp"
47 | fi
48 | fi
49 |
50 | # Check Package
51 | if check_package "sudo"; then
52 | # User Add to sudoers Question
53 | if question --default no "Do you want to allow this user access to sudo? (y/N)" || [ $SUDO = 1 ]; then
54 | manage-user-add-group $USER "sudo"
55 | else
56 | manage-user-remove-group $USER "sudo"
57 | fi
58 | fi
59 | }
60 |
61 | # Attended Mode
62 | if [ $UNATTENDED = 0 ]; then
63 | # User Check
64 | manage-user-input-check
65 |
66 | # Module Function
67 | module
68 | # Unattended Mode
69 | else
70 | # Define Arrays
71 | USERLIST=$(read_variable_module user),
72 | PASSLIST=$(read_variable_module pass),
73 | HTTPLIST=$(read_variable_module http),
74 | PERMLIST=$(read_variable_module perm),
75 | SSHLIST=$(read_variable_module ssh),
76 | SFTPLIST=$(read_variable_module sftp),
77 |
78 | # Loop Through Users
79 | while echo $USERLIST | grep -q \,; do
80 | # Define Variables
81 | USER=${USERLIST%%\,*}
82 | PASS=${PASSLIST%%\,*}
83 | HTTP=${HTTPLIST%%\,*}
84 | PERM=${PERMLIST%%\,*}
85 | SSH=${SSHLIST%%\,*}
86 | SFTP=${SFTPLIST%%\,*}
87 |
88 | # Remove Current From List
89 | USERLIST=${USERLIST#*\,}
90 | PASSLIST=${PASSLIST#*\,}
91 | HTTPLIST=${HTTPLIST#*\,}
92 | PERMLIST=${PERMLIST#*\,}
93 | SSHLIST=${SSHLIST#*\,}
94 | SFTPLIST=${SFTPLIST#*\,}
95 |
96 | # Check User Array State
97 | manage-user-check-array $USERLIST
98 |
99 | # Module Function
100 | module
101 | done
102 |
103 | # Unset Arrays
104 | unset USERLIST
105 | unset PASSLIST
106 | unset HTTPLIST
107 | unset PERMLIST
108 | unset SSHLIST
109 | unset SFTPLIST
110 |
111 | # Unset Variables
112 | unset USER
113 | unset PASS
114 | unset HTTP
115 | unset PERM
116 | unset SSH
117 | unset SFTP
118 | fi
119 |
120 | # Unset Init
121 | unset -f init
122 |
--------------------------------------------------------------------------------
/modules/manage-user-remove/config.ini:
--------------------------------------------------------------------------------
1 | ; Manage: User Remove
2 | [manage_user_manage]
3 | ; Usernames (Comma Separated)
4 | user="main"
5 |
--------------------------------------------------------------------------------
/modules/manage-user-remove/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Manage: User Remove
3 |
4 | # Manage User
5 | manage-user
6 |
7 | # Module Function
8 | module() {
9 | # Check User
10 | manage-user-check-user $USER
11 |
12 | # Remove User
13 | manage-user-manage-remove $USER
14 | }
15 |
16 | # Attended Mode
17 | if [ $UNATTENDED = 0 ]; then
18 | # User Check
19 | manage-user-input-check
20 |
21 | # Module Function
22 | module
23 | # Unattended Mode
24 | else
25 | # Define Arrays
26 | USERLIST=$(read_variable_module user),
27 |
28 | # Loop Through Users
29 | while echo $USERLIST | grep -q \,; do
30 | # Define Variables
31 | USER=${USERLIST%%\,*}
32 |
33 | # Remove Current From List
34 | USERLIST=${USERLIST#*\,}
35 |
36 | # Check User Array State
37 | manage-user-check-array $USERLIST
38 |
39 | # Module Function
40 | module
41 | done
42 |
43 | # Unset Arrays
44 | unset USERLIST
45 |
46 | # Unset Variables
47 | unset USER
48 | fi
49 |
50 | # Unset Init
51 | unset -f init
52 |
--------------------------------------------------------------------------------