-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstealth-mode
More file actions
executable file
·39 lines (35 loc) · 1001 Bytes
/
stealth-mode
File metadata and controls
executable file
·39 lines (35 loc) · 1001 Bytes
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
#!/bin/bash
# @author sdrfnord
# @license GPLv3+
# Disable all unneeded daemons and other stuff to put my system into stealth mode ;)
# Disable network activity as far as possible in this mode.
# Always exit on errors
set -e
# Undefined variables, we don't like you
# set -u
# ERR traps are inherited by shell functions, command substitutions and
# commands executed in a subshell environment.
set -E
start_in_stealth_mode=()
stop_in_stealth_mode=('avahi-daemon')
case "$1" in
start)
for service in $stop_in_stealth_mode; do
service "$service" stop
done
for service in $start_in_stealth_mode; do
service "$service" start
done
;;
stop)
for service in $stop_in_stealth_mode; do
service "$service" start
done
for service in $start_in_stealth_mode; do
service "$service" stop
done
;;
*)
echo 'Please call script with "start" or "stop".'
;;
esac