-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path003-hosting
executable file
·44 lines (38 loc) · 1.3 KB
/
003-hosting
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Query for a hosting profile and apply various patches
# This script creates a file at /etc/hosting-profile with the selected profile
source common
PROFILEFILE="/etc/hosting-profile"
if [ -e "$PROFILEFILE" ]; then
INIT skip "Hosting profile already set"
exit 0
fi
INIT status "Hosting profile setup"
echo
echo "Select the hosting profile from the following list:"
echo
echo "# Host Patches applied"
echo "--------------------------------------------------------"
echo "n Normal / standalone (none)"
echo "do Digital Ocean (none)"
echo "bl Binary Lane deny-passwords + swap + ulimits + journdald + swappiness"
echo
PROFILE=`INIT ask --prompt "Hosting profile" --default "n"`
if [ "$PROFILE" == "n" ]; then
echo "Selected normal hosting profile - applying no patches"
echo "standalone" | sudo tee "$PROFILEFILE" >/dev/null
elif [ "$PROFILE" == "do" ]; then
echo "Selected Digital Ocean hosting profile - applying no patches"
echo "digialocean" | sudo tee "$PROFILEFILE" >/dev/null
elif [ "$PROFILE" == "bl" ]; then
INIT status "Apply Binary Lane patches"
./003-deny-passwords
./003-swap
./003-ulimits
./003-journald
./003-swappiness
echo "binarylane" | sudo tee "$PROFILEFILE" >/dev/null
else
echo "Invalid hosting profile"
exit 1
fi