mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-26 23:36: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
|
[ ! -f "$ZEALDISK" ] && echo "\$ZEALDISK is not a path to a file." && exit 1
|
||||||
|
|
||||||
TMPMOUNT=/tmp/zealtmp
|
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() {
|
mount_vdisk() {
|
||||||
echo "Mounting virtual disk..."
|
echo "Mounting virtual disk..."
|
||||||
|
@ -38,7 +45,7 @@ umount_vdisk() {
|
||||||
|
|
||||||
if [ -z $1 ]
|
if [ -z $1 ]
|
||||||
then
|
then
|
||||||
echo $USAGE
|
print_usage
|
||||||
else
|
else
|
||||||
sudo modprobe nbd
|
sudo modprobe nbd
|
||||||
[ ! -d $TMPMOUNT ] && mkdir $TMPMOUNT
|
[ ! -d $TMPMOUNT ] && mkdir $TMPMOUNT
|
||||||
|
@ -71,7 +78,7 @@ else
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown action."
|
echo "Unknown action."
|
||||||
echo $USAGE
|
print_usage
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue