mirror of
https://github.com/RGBCube/ncc
synced 2025-07-29 19:17:45 +00:00
Scripts: Fix script logic
This commit is contained in:
parent
aa93b53caf
commit
714737a229
1 changed files with 9 additions and 3 deletions
12
rebuild.sh
12
rebuild.sh
|
@ -1,14 +1,20 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [[ "$1" = "--help" ]] || [[ "$1" = "-h" ]]; then
|
if [[ $1 = "--help" ]] || [[ $1 = "-h" ]]; then
|
||||||
echo "Usage: rebuild.sh [-h | --help] [-c | --clean-garbage] [machine]"
|
echo "Usage: rebuild.sh [-h | --help] [-c | --clean-garbage] [machine]"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo true
|
sudo true
|
||||||
|
|
||||||
if [[ -n "$1" ]]; then
|
if [[ -n $1 ]]; then
|
||||||
machine = $1
|
if [[ $1 != "-c" && $1 != "--clean-garbage" ]]; then
|
||||||
|
machine = $1
|
||||||
|
elif [[ -n $2 ]]; then
|
||||||
|
machine = $1
|
||||||
|
else
|
||||||
|
read -p "What machine would you want to build? [$(ls --format=commas machines)]: " machine
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
read -p "What machine would you want to build? [$(ls --format=commas machines)]: " machine
|
read -p "What machine would you want to build? [$(ls --format=commas machines)]: " machine
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue