home · contact · privacy
Add missed semicolon.
[config] / bookworm / setup_scripts / misc.sh
1 #!/bin/sh
2 set -e
3 debian_version="bookworm"
4 legal_system_names="x220 w530"
5 config_tree_prefix="${HOME}/public_repos/config/${debian_version}"
6 if [ ! -d "${config_tree_prefix}" ]; then
7     config_tree_prefix="${HOME}/config/${debian_version}"
8 fi
9 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
10 aptmark_dir="${config_tree_prefix}/apt-mark"
11
12 expect_n_args() {
13     min_args="$1"
14     explainer="$2"
15     shift 2
16     if [ "$#" -lt "${min_args}" ]; then
17         echo "Need at least ${1} arguments … ${explainer}"
18         false
19     fi
20 }
21
22 get_system_name_arg() {
23     found=0
24     for system_name_i in $legal_system_names; do
25         if [ "$1" = "$system_name_i" ]; then
26             found=1
27             system_name="${system_name_i}"
28             continue    
29         fi
30     done
31     if [ "$found" = 0 ]; then
32         echo "Need legal system name."
33         false
34     fi
35 }