mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-26 07:20:32 +00:00
Create usage printing function
This commit is contained in:
parent
076542f12c
commit
e9b4b2c062
1 changed files with 10 additions and 3 deletions
|
@ -19,7 +19,14 @@ ZEALDISK=
|
|||
[ ! -f "$ZEALDISK" ] && echo "\$ZEALDISK is not a path to a file." && exit 1
|
||||
|
||||
TMPMOUNT=/tmp/zealtmp
|
||||
USAGE="Usage: $0 [ repo | vm ] \n\n repo - overwrites src/ with virtual disk contents.\n vm - overwrites virtual disk with src/ contents.\n"
|
||||
|
||||
print_usage() {
|
||||
echo "Usage: $0 [ repo | vm ]"
|
||||
echo
|
||||
echo "repo - overwrites src/ with virtual disk contents."
|
||||
echo "vm - overwrites virtual disk with src/ contents."
|
||||
echo
|
||||
}
|
||||
|
||||
mount_vdisk() {
|
||||
echo "Mounting virtual disk..."
|
||||
|
@ -38,7 +45,7 @@ umount_vdisk() {
|
|||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
echo $USAGE
|
||||
print_usage
|
||||
else
|
||||
sudo modprobe nbd
|
||||
[ ! -d $TMPMOUNT ] && mkdir $TMPMOUNT
|
||||
|
@ -71,7 +78,7 @@ else
|
|||
;;
|
||||
*)
|
||||
echo "Unknown action."
|
||||
echo $USAGE
|
||||
print_usage
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue