2/16/23
This commit is contained in:
40
install/build.sh
Normal file
40
install/build.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $(/usr/bin/id -u) != "0" ]; then
|
||||
printf "[x] Must be run as root.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
WORKING_DIR=$(pwd)
|
||||
SRC_DIR=$(pwd)/../src
|
||||
|
||||
parse_install_conf() {
|
||||
source ${WORKING_DIR}/install.conf
|
||||
if [ "$?" != "0" ]; then
|
||||
printf "[x] install.conf not found.\n"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
installpkg() {
|
||||
install ${SRC_DIR}/gpkg /bin
|
||||
install ${SRC_DIR}/syspkg /bin
|
||||
install ${SRC_DIR}/gquery /bin
|
||||
install ${SRC_DIR}/glist /bin
|
||||
}
|
||||
|
||||
case $1 in
|
||||
install)
|
||||
parse_install_conf "$@"
|
||||
installpkg "$@"
|
||||
;;
|
||||
update)
|
||||
parse_install_conf "$@"
|
||||
installpkg "$@"
|
||||
;;
|
||||
*)
|
||||
printf "[x] Unknown option.\n"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user