-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_post_install_script.sh
45 lines (33 loc) · 1.11 KB
/
1_post_install_script.sh
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
#!/usr/bin/env bash
# shellcheck disable=SC2034,SC1091,SC2154
current_dir="$(pwd)"
unypkg_script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
unypkg_root_dir="$(cd -- "$unypkg_script_dir"/.. &>/dev/null && pwd)"
cd "$unypkg_root_dir" || exit
#############################################################################################
### Start of script
groupadd -r rsyncd
useradd -c "rsyncd Daemon User" -d /var/rsync -g rsyncd \
-s /bin/false -r rsyncd
mkdir -pv /etc/uny/rsync
if [ ! -f /etc/uny/rsync/rsyncd.conf ]; then
cat >/etc/uny/rsync/rsyncd.conf <<"EOF"
# This is a basic rsync configuration file
# It exports a single module without user authentication.
motd file = /var/rsync/welcome
use chroot = yes
[localhost]
path = /var/rsync
comment = Default rsync module
read only = yes
list = yes
uid = rsyncd
gid = rsyncd
EOF
fi
if [ ! -d /var/rsync ]; then
install -v -dm 755 -o postfix -g postfix /var/rsync
fi
#############################################################################################
### End of script
cd "$current_dir" || exit