-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontainer.sh
executable file
·54 lines (38 loc) · 1.05 KB
/
container.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
46
47
48
49
50
51
52
53
54
#!/bin/bash
#DO NOT EXECUTE OUTSIDE OF CONTAINER
# config
. /home/config.txt
#Upgrade if we used tar for building container
if [ $1 = "-a" ]
then
#I LOVE CANDY
#echo ILoveCandy >> /etc/pacman.conf
http_proxy=$http_proxy https_proxy=$https_proxy pacman -Syu --noconfirm
http_proxy=$http_proxy https_proxy=$https_proxy pacman -S $pkg --needed --noconfirm
fi
#create user
chmod 755 /
useradd $user
echo "$user:$password"| chpasswd
echo "root:$password"| chpasswd
echo "arch ALL=(ALL) ALL" >> /etc/sudoers
echo "Defaults:arch !env_reset"
chown $user /opt
mkdir /home/$user
chown $user /home/$user
#Build nginx-rtmp in userspace shell
http_proxy=$http_proxy https_proxy=$https_proxy su - $user << EOF
pwd
#clone
cd /opt
http_proxy=$http_proxy https_proxy=$https_proxy git clone https://aur.archlinux.org/nginx-rtmp.git
cd nginx-rtmp
http_proxy=$http_proxy https_proxy=$https_proxy makepkg -si --noconfirm
EOF
#copy&create misc files&dirs
mkdir /var/www
mv /home/nginx.conf /etc/nginx/nginx.conf
#enable services
systemctl enable nginx
systemctl enable dropbear
exit