Skip to content

Commit 991c877

Browse files
Added support for copying admin scripts
1 parent f0eaf2b commit 991c877

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

adm/adm_script.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
echo "Enable and start <ssh> in systemctl"
2+
sudo systemctl enable ssh
3+
sudo systemctl start ssh
4+
5+
echo "Enable firewall"
6+
sudo ufw enable
7+
sudo ufw allow ssh

scripts/copy_admin_scripts.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
source vars.sh
2+
3+
cd $ADMIN_SCRIPTS_DIR
4+
5+
homedir="/home/$ADMIN_USER"
6+
for file in *; do
7+
cp -rv $file "$homedir/"
8+
chown -R -c -v $user:$user "$homedir/$file"
9+
chmod -R -v 750 "$homedir/$file"
10+
done
11+
12+
cd -

scripts/run_order.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ openssh_server.sh
66
dist_upgrade.sh
77
add_users.sh
88
copy_dots.sh
9+
copy_admin_scripts.sh

vars.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
DOTS_DIR="dots"
2+
SCRIPTS_DIR="scripts"
3+
ADMIN_SCRIPTS_DIR="adm"
4+
15
ADMIN_USER="admin"
26
ADMIN_PASSWORD='$1$qOaJpMTn$udSLvrlWWiT43He1M2wy5.'
37
# encrypted with $(openssl passwd -1 PLAINTEXTPASSWORD)
@@ -6,4 +10,3 @@ TEAM_USER="contestant"
610
TEAM_PASSWORD='$1$92hYmWFk$qPeMP85ThFuzlKbdgh3cu0'
711
# encrypted with $(openssl passwd -1 PLAINTEXTPASSWORD)
812

9-
DOTS_DIR="dots"

0 commit comments

Comments
 (0)