Install bash in Linux by yourself

Source: Internet
Author: User
Tags unpack
Every time you install a linux package, you need to install config make install one by one. If you leave it blank, check some information and write a bash installation script, openldapujs, freeradiusujs, and checkuserujs packages are installed respectively. /install. sh. Put the three packages in the work directory folder in the same directory as install. Install the configuration in jsradius. ebuild. Install. Sh #! /Usr/bin/ENV bash conf = "jsradius. ebuild"
If [! -E $ conf]
Then
Echo "can't find ujsradius. ebuild ."
Exit 1
Fi if [$ #-ne 1]
Then
Echo "only one parameter is permitted ."
Exit 1
FI source $ conf export origdir = 'pwd'
Export workdir =$ {origdir}/work
Export srcdir1 =$ {workdir}/$ {p1}
Export srcdir2 =$ {workdir}/$ {P2}
Export srcdir2 =$ {workdir}/$ {P3} ebuild_unpack (){
# Make sure we're in the right directory
CD $ {origdir} if [-d $ {workdir}]
Then
Rm-RF $ {workdir}
FI mkdir $ {workdir}
CD $ {workdir}
If [! -E $ {origdir}/$ {A1}]
Then
Echo "$ {origdir}/$ {A1} does not exist. Please download first ."
Exit 1
Fi
Tar xzf $ {origdir}/$ {A1}
Echo "unpacked $ {origdir}/$ {A1 }."
If [! -E $ {origdir}/$ {A2}]
Then
Echo "$ {origdir}/$ {A2} does not exist. Please download first ."
Exit 1
Fi
Tar xzf $ {origdir}/$ {A2}
Echo "unpacked $ {origdir}/$ {A2 }."
If [! -E $ {origdir}/$ {A3}]
Then
Echo "$ {origdir}/$ {A3} does not exist. Please download first ."
Exit 1
Fi
Tar xzf $ {origdir}/$ {A3}
Echo "unpacked $ {origdir}/$ {A2}." # source is now correctly unpacked
} Ebuild_compile (){
If [! -D "$ {srcdir1}"]
Then
Echo "$ {srcdir1} does not exist -- Please unpack first ."
Exit 1
Fi
# Make sure we're in the right directory
CD $ {srcdir1}
User_compile_ldap
If [! -D "$ {srcdir2}"]
Then
Echo "$ {srcdir2} does not exist -- Please unpack first ."
Exit 1
Fi
# Make sure we're in the right directory
CD $ {srcdir2}
User_compile_radius
If [! -D "$ {srcdir3}"]
Then
Echo "$ {srcdir3} does not exist -- Please unpack first ."
Exit 1
Fi
# Make sure we're in the right directory
CD $ {srcdir3}
User_compile_checkuser
} Case "$ {1}" in
Unpack)
Ebuild_unpack
;;
Compile)
Ebuild_compile
;;
Install)
Ebuild_install
;;
All)
Ebuild_unpack
Ebuild_compile
Ebuild_install
;;
*)
Echo "Please specify unpack, compile, install or all as the parameter"
Exit 1
;;
Esacjsradius. ebuild # jsradius ebuild conf write by cz_hyfmakeopts = "-J2"
1 = openldapujs-2.0.25
P2 = freeradiusujs-0.8.1
3 = checkuserujs-1.0
A11_1_1_p12.16.tar.gz
A21_1_1_p21_.tar.gz
A32.161_p32.16.tar.gz user_compile_ldap () {if [-e configure]
Then
./Configure
./Make depend
Fi
Make $ makeopts make = "make $ makeopts"
} User_compile_radius () {if [-e configure]
Then
./Configure
Fi
Make $ makeopts make = "make $ makeopts"
} User_compile_checkuser () {if [-e configure]
Then
./Configure
Fi
Make $ makeopts make = "make $ makeopts"} install #! /Usr/bin/ENV bash conf = "ujsradius. ebuild"
If [! -E $ conf]
Then
Echo "can't find ujsradius. ebuild ."
Exit 1
Fi if [$ #-ne 1]
Then
Echo "only one parameter is permitted ."
Exit 1
FI source $ conf export origdir = 'pwd'
Export workdir =$ {origdir}/work
Export srcdir1 =$ {workdir}/$ {p1}
Export srcdir2 =$ {workdir}/$ {P2}
Export srcdir2 =$ {workdir}/$ {P3} ebuild_unpack (){
# Make sure we're in the right directory
CD $ {origdir} if [-d $ {workdir}]
Then
Rm-RF $ {workdir}
FI mkdir $ {workdir}
CD $ {workdir}
If [! -E $ {origdir}/$ {A1}]
Then
Echo "$ {origdir}/$ {A1} does not exist. Please download first ."
Exit 1
Fi
Tar xzf $ {origdir}/$ {A1}
Echo "unpacked $ {origdir}/$ {A1 }."
If [! -E $ {origdir}/$ {A2}]
Then
Echo "$ {origdir}/$ {A2} does not exist. Please download first ."
Exit 1
Fi
Tar xzf $ {origdir}/$ {A2}
Echo "unpacked $ {origdir}/$ {A2 }."
If [! -E $ {origdir}/$ {A3}]
Then
Echo "$ {origdir}/$ {A3} does not exist. Please download first ."
Exit 1
Fi
Tar xzf $ {origdir}/$ {A3}
Echo "unpacked $ {origdir}/$ {A2}." # source is now correctly unpacked
} Ebuild_compile (){
If [! -D "$ {srcdir1}"]
Then
Echo "$ {srcdir1} does not exist -- Please unpack first ."
Exit 1
Fi
# Make sure we're in the right directory
CD $ {srcdir1}
User_compile_ldap
If [! -D "$ {srcdir2}"]
Then
Echo "$ {srcdir2} does not exist -- Please unpack first ."
Exit 1
Fi
# Make sure we're in the right directory
CD $ {srcdir2}
User_compile_radius
If [! -D "$ {srcdir3}"]
Then
Echo "$ {srcdir3} does not exist -- Please unpack first ."
Exit 1
Fi
# Make sure we're in the right directory
CD $ {srcdir3}
User_compile_checkuser
} Case "$ {1}" in
Unpack)
Ebuild_unpack
;;
Compile)
Ebuild_compile
;;
Install)
Ebuild_install
;;
All)
Ebuild_unpack
Ebuild_compile
Ebuild_install
;;
*)
Echo "Please specify unpack, compile, install or all as the parameter"
Exit 1
;;
Esac reference: http://www-128.ibm.com/developerworks/cn/linux/shell/bash/bash-1/index.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.