~mil/f_scripts

ref: 0.2 f_scripts/genscripts/gen_localdev.sh -rwxr-xr-x 374 bytes
4522c8b5Miles Alan f_networks: Ensure networkmanager running on boot 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env osh

alldeps() {
  cat scripts/* |
    grep DEP | 
    cut -d= -f2 |
    tr -d '"' |
    grep -oE '[0-9a-zA-Z_-]+' |
    tr '\n' ' '
}

installalldeps() {
  [ $(whoami) = root ] || { echo "Run as root"; kill 0; }
  DEPS="$(alldeps)"
  apk add $DEPS
}

main() {
  cd "$(dirname $(realpath $0))/../"
  installalldeps
}

if [ -n "$1" ]; then "$@"; else main; fi