-
-
Notifications
You must be signed in to change notification settings - Fork 378
Expand file tree
/
Copy pathumask
More file actions
22 lines (17 loc) · 578 Bytes
/
umask
File metadata and controls
22 lines (17 loc) · 578 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function f_umask {
echo "[$SCRIPT_COUNT] umask"
if [ -f /etc/init.d/rc ]; then
sed -i 's/umask 022/umask 077/g' /etc/init.d/rc
fi
if ! grep -q -i "umask" "/etc/profile" 2> /dev/null; then
echo "umask 077" >> /etc/profile
fi
if ! grep -q -i "umask" "/etc/bash.bashrc" 2> /dev/null; then
echo "umask 077" >> /etc/bash.bashrc
fi
if ! grep -q -i "TMOUT" "/etc/profile.d/*" 2> /dev/null; then
echo -e 'TMOUT=600\nreadonly TMOUT\nexport TMOUT' > '/etc/profile.d/autologout.sh'
chmod +x /etc/profile.d/autologout.sh
fi
((SCRIPT_COUNT++))
}