forked from alnux/aps
21 lines
495 B
Bash
Executable file
21 lines
495 B
Bash
Executable file
#!/bin/sh
|
|
|
|
########################################
|
|
# Repo, a repository manager for alnux #
|
|
########################################
|
|
if [ $(whoami) != root ]; then
|
|
echo "[E] Run as root!"
|
|
kill 2
|
|
else
|
|
case $1 in
|
|
# add a repo
|
|
add) git clone https://${3}/${2}.git /var/aps/repos/${2}
|
|
echo "${2}" >> /etc/al/repo.conf
|
|
;;
|
|
# update a repo
|
|
update) pushd && cd /var/aps/repos/${2} && git pull && popd ;;
|
|
# destroy a repo (remove)
|
|
destroy) rm -rfv /var/aps/repos/${2} ;;
|
|
|
|
esac
|
|
fi
|