forked from littlebizzy/slickstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ss-perms-ubuntu-swapfile.txt
60 lines (45 loc) · 3.3 KB
/
ss-perms-ubuntu-swapfile.txt
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
####################################################################################################
#### author: SlickStack ############################################################################
#### link: https://slickstack.io ###################################################################
#### mirror: https://mirrors.slickstack.io/bash/ss-perms-ubuntu-swapfile.txt #######################
#### path: /var/www/ss-perms-ubuntu-swapfile #######################################################
#### destination: n/a (not a boilerplate) ##########################################################
#### purpose: Resets all file and user permissions for the Ubuntu swapfile #########################
#### module version: Ubuntu 20.04 LTS ##############################################################
#### sourced by: ss-perms, ss-install-ubuntu-swapfile ##############################################
#### bash aliases: ss perms [swap|swapfile], ss perms ubuntu [swap|swapfile] #######################
####################################################################################################
## source ss-config ##
source /var/www/ss-config
## source ss-functions ##
source /var/www/ss-functions
## BELOW THIS RELIES ON SS-CONFIG AND SS-FUNCTIONS
####################################################################################################
#### SS-Perms-Ubuntu-Swapfile: Message (Begin Script) ##############################################
####################################################################################################
## this is a simple message that announces to the shell the purpose of this bash script ##
## it will only be noticed by sudo users who manually call ss core bash scripts ##
## echo message ##
echo -e "${PURPLE}Running ss-perms-ubuntu-swapfile: Resets all file and user permissions for the Ubuntu swapfile... ${NOCOLOR}"
sleep "$SLEEP_MESSAGE_BEGIN"
####################################################################################################
#### SS-Perms-Ubuntu-Swap: Reset Permissions (SSH) ##################################################
####################################################################################################
mkdir /var/www/cache/system
chown root:root /var/www/cache/system ## must be root:root
chmod 0600 /var/www/cache/system ## must be 0600
chown root:root /var/www/cache/system/swapfile ## must be root:root
chmod 0600 /var/www/cache/system/swapfile ## must be 0600
####################################################################################################
#### SS-Perms-Ubuntu-Swapfile: Touch Timestamp File (End Script) ###################################
####################################################################################################
## this is a dummy timestamp file that will remember the last time this script was run ##
## it can be useful for developer reference and is sometimes used by SlickStack ##
## script timestamp ##
touch "$TIMESTAMP_SS_PERMS_UBUNTU_SWAPFILE"
####################################################################################################
#### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ###############
####################################################################################################
## Ref:
## SS_EOF