From 6510fd413243471f4b33762354d8d681297274ce Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Tue, 24 Aug 2021 07:32:32 +0200 Subject: [PATCH] Add repo and install.sh --- altools/repo | 13 +++++++++++++ altools/sel | 4 +++- aps | 0 install.sh | 18 ++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 altools/repo mode change 100644 => 100755 aps create mode 100755 install.sh diff --git a/altools/repo b/altools/repo new file mode 100644 index 0000000..3e8aa26 --- /dev/null +++ b/altools/repo @@ -0,0 +1,13 @@ +#!/bin/sh + +######################################## +# Repo, a repository manager for alnux # +######################################## +if [ $(whoami) != root ]; then + echo "[E] Run as root!" + kill 2 +else + case $1 in + add) git clone https://${3}/${2}.git /var/aps/repos/${2} ;; + esac +fi diff --git a/altools/sel b/altools/sel index 12217c4..b159cf1 100755 --- a/altools/sel +++ b/altools/sel @@ -5,7 +5,8 @@ ######################### . "/etc/al/lnver.v" case $1 in - linux) case $2 in + linux) if [ $(whoami) != root ]; then + case $2 in list) ls /usr/src/ | grep 'linux' && ls -L /usr/src/linux 2>/dev/null ;; @@ -22,4 +23,5 @@ case $1 in echo "pkg_config_depends=''" >> /var/aps/packages/linux/package ;; esac + fi esac diff --git a/aps b/aps old mode 100644 new mode 100755 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..830394d --- /dev/null +++ b/install.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +########################## +# INSTALL SCRIPT FOR APS # +########################## +case $1 in + --prefix) prefix=$2 ;; + *) prefix=/ +esac +if [ ${prefix} == / ]; then + if [ $(whoami) != root ]; then + echo '[E] You must run as root!' + kill 2 + fi +else + install -v aps ${prefix}/usr/bin/ && + install -v altools/sel ${prefix}/usr/bin/ +fi