summaryrefslogtreecommitdiff
path: root/init
blob: 2502e13a3bef8d57e3f89df7d51f80bd5a87b936 (plain)
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
#!/usr/bin/env bash

# init
# Craig Jennings <c@cjennings.net>
# The initial archsetup script. Downloads and calls other scripts.


# welcome user, present options, and setup ssh
# server from the live cd. Functions to installing base arch and setup
# the workstation occur in other scripts, called by this script.

# Run as root after booting the live cd and issuing the following command:
#   curl -s https://cjennings.net/archsetup/init | bash -i

##
## CHECK ROOT
##
if [ "$EUID" -ne 0 ]
then echo "Must run as root"
     exit
fi



##
## SSH
##
echo "setting up ssh daemon..."
systemctl start sshd
echo "root:welcome" | chpasswd
hostname=$(</etc/hostname)
ipaddress=$(ip addr show wlan0 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)

# notify user
echo ""; echo ""
echo "you may ssh root@$hostname or ssh root@$ipaddress using the password 'welcome'"
}