Browse Source

make getproot function it's own shell script; getchroot to only get chroots

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
pull/3/head
Thorsten Liebig 6 years ago
parent
commit
f8604898a8
2 changed files with 49 additions and 30 deletions
  1. +3
    -30
      getchroot
  2. +46
    -0
      getproot

+ 3
- 30
getchroot View File

@@ -38,18 +38,12 @@ function print_help {
./getchroot [option] <folder>

[option]: arch squeeze wheezy sid precise raring fedora
This will download a prepared tar.xz file to ~/.getchroot/ and extract to your given folder

[option]: proot
This will download a precompiled version of proot for x86_64
This will download a prepared tar.xz file to $_CHROOT and extract to your given folder

EXAMPLES

:~$ ./getchroot arch mychrootarch/
This will download arch.tar.xz to ~/.getchroot/ if not available and extract it to mychrootarch/

:~$ ./getchroot proot
This will download a precompiled proot binary for x86_64 to ~/.bin/proot/ and add this path to your ~/.bashrc
This will download arch.tar.xz to $_CHROOT if not available and extract it to mychrootarch/

:~$ ./getchroot update arch
This will compare your local tar.xz container file with the online version. If they are different, it will be downloaded again.
@@ -57,29 +51,8 @@ function print_help {

}

function get_proot {

printf "wget prebuild x86_64 proot binary\n"
mkdir -p ~/.bin/proot/
wget -O ~/.bin/proot/proot http://static.proot.me/proot-x86_64
chmod u+x ~/.bin/proot/proot
echo "PATH=\$PATH:~/.bin/proot/" >> ~/.bashrc
echo "export PATH" >> ~/.bashrc
. ~/.bashrc

}

if (("$#" == 1)); then

if [[ "$1" = "--help" ]]; then
print_help
exit

elif [[ "$1" = "proot" ]]; then
get_proot
fi

elif (("$#" == 2)); then
if (("$#" == 2)); then

case "$1" in
"arch") build_chroot $1 $2 ;;


+ 46
- 0
getproot View File

@@ -0,0 +1,46 @@
#!/bin/bash

set -e

function get_proot {

printf "wget prebuild x86_64 proot binary\n"
mkdir -p ~/.bin/proot/
wget -O ~/.bin/proot/proot http://static.proot.me/proot-x86_64
chmod u+x ~/.bin/proot/proot
echo "PATH=\$PATH:~/.bin/proot/" >> ~/.bashrc
echo "export PATH" >> ~/.bashrc
. ~/.bashrc

}


function print_help {

echo '
Usage:
./getproot
This will download a precompiled proot binary for x86_64 to ~/.bin/proot/ and add this path to your ~/.bashrc
'

}

if (("$#" == 1)); then

if [[ "$1" = "--help" ]]; then
print_help
exit

else
echo "unknown argument"
print_help
exit
fi

elif (("$#" > 1)); then
printf "Wrong usage!\n\n"
print_help
exit
else
get_proot
fi

Loading…
Cancel
Save