summaryrefslogtreecommitdiff
path: root/init
blob: bf22cd31312ab5812ffebf6bda8d8c977192f508 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# update and install tmux and git
pacman -Sy --noconfirm
pacman -S --noconfirm tmux git

# change the root password
echo "root:welcome" | chpasswd

# find the hostname from the file
hostname=$(</etc/hostname)

# identify which interface is up, then find the ip address
interface_up=$(ip addr show | grep "state UP" -B2 | head -n1 | awk '{print $2}' | sed 's/://')
ipaddress=$(ip addr show $(interface_up) | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)

# start the ssh daemon
systemctl start sshd

echo ""; echo ""; echo "init complete. "
echo "you may ssh root@$hostname or ssh root@$ipaddress using the password 'welcome'"