aboutsummaryrefslogtreecommitdiffstats
path: root/init-sh/msec
blob: 1ba1bb2b13edc4a1ec3cac8d182a3f72b09b5d82 (plain)
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
#!/bin/bash

# Trap the sigint signal
# so the msec process / subprocess can not be aborted by the user...
# This will avoid trashing of config file while they are modified 
# if msec is interupted. ( thanks fg ).

trap "" sigint

if [[ -z $1 ]]; then
	echo "Usage : $0 [0-5]"
	echo "Usage : $0 \"custom\""
	exit 1
fi


if [[ ${1} == custom ]]; then
	/usr/share/msec/custom.sh
	echo
	echo "You might logout of your session for some change to be activated."
	echo
	exit 0;
fi

if [[ -f /usr/share/msec/level$1.sh ]]; then
	/usr/share/msec/level$1.sh
	echo
	echo "You might logout of your session for some change to be activated."
	echo
	if [[ -f /usr/share/msec/perm.$1 ]]; then
		/usr/share/msec/file_perm.sh /usr/share/msec/perm.$1
	else
		echo "Couldn't find the default permissions for level $1."
	fi
else
    echo "Security level $1 not availlable..."
fi