DEVELOPMENT ENVIRONMENT

~liljamo/src.quest-anemos

ref: 819e19058d78bf3983864df9e892d17ebfe91f86 src.quest-anemos/justfile -rw-r--r-- 780 bytes
819e1905Jonni Liljamo chore: update makeimg.nix 8 days ago
                                                                                
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
_default:
    just --list

# Check if host directory exists
host-dir-exists host:
    #!/usr/bin/env sh
    if [ ! -d {{host}} ]; then
        echo "{{host}} does not exist"
        exit 1
    fi

# Check host reachability via ping
host-reachable host: (host-dir-exists host)
    #!/usr/bin/env sh
    ping -w 1 -c 1 $(cat ./{{host}}/ADDRESS)
    if [ $? -ne 0 ]; then
        echo "{{host}} is not reachable"
        exit 1
    fi

# Test the IMGBUILD by building an image
test host: (host-dir-exists host)
    #!/usr/bin/env sh
    cd ./{{host}}
    sudo makeimg --format "raw 4g msdos ext4"

get-anemos host: (host-reachable host)
    #!/usr/bin/env/sh
    address=$(cat ./{{host}}/ADDRESS)
    ssh root@$address wget https://git.sr.ht/~bitfehler/anemos-cli/blob/master/anemos