From 37c4c9ada52ef7fbdfe3c21138298ee6d8fc50e7 Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent@modolo.fr>
Date: Tue, 22 Sep 2020 09:08:06 +0200
Subject: [PATCH] split config script to match ifb requirements

---
 deploy.sh                    |  8 ++++++++
 server_init.sh => install.sh | 10 +---------
 2 files changed, 9 insertions(+), 9 deletions(-)
 create mode 100644 deploy.sh
 rename server_init.sh => install.sh (58%)

diff --git a/deploy.sh b/deploy.sh
new file mode 100644
index 0000000..3721168
--- /dev/null
+++ b/deploy.sh
@@ -0,0 +1,8 @@
+USER_PASSWORD=$( openssl rand -hex 12 )
+sudo passwd etudiant << EOF
+${USER_PASSWORD}
+${USER_PASSWORD}
+EOF
+HTTP_ENDP="https://$HOST_NAME"
+ss-set url.service "${HTTP_ENDP}"
+ss-set ss:url.service "[HTTPS]$HTTP_ENDP,[LOGIN]$etudiant,[PASSWORD]$USER_PASSWORD"
diff --git a/server_init.sh b/install.sh
similarity index 58%
rename from server_init.sh
rename to install.sh
index 6dc5f0d..2a3b5ef 100644
--- a/server_init.sh
+++ b/install.sh
@@ -5,16 +5,8 @@ sudo iptables -t filter -A INPUT -p tcp --dport 443 -j ACCEPT
 sudo iptables -t filter -A OUTPUT -p tcp --dport 443 -j ACCEPT
 sudo iptables-save
 sudo systemctl restart shellinabox
-sudo useradd -m -s /bin/bash -g users -G adm,dialout,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev etudiant
+sudo useradd -m -s /bin/bash -g users -G adm,dialout,cdrom,floppy,audio,dip,video,plugdev,netdev etudiant
 sudo cp /etc/skel/.* /home/etudiant/
 
-USER_PASSWORD=$( openssl rand -hex 12 )
-sudo passwd etudiant << EOF
-${USER_PASSWORD}
-${USER_PASSWORD}
-EOF
-HTTP_ENDP="https://$HOST_NAME"
-ss-set url.service "${HTTP_ENDP}"
-ss-set ss:url.service "[HTTPS]$HTTP_ENDP,[LOGIN]$etudiant,[PASSWORD]$USER_PASSWORD"
 
 
-- 
GitLab