2021-08-24 08:32:32 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
########################################
|
|
|
|
# Repo, a repository manager for alnux #
|
|
|
|
########################################
|
|
|
|
if [ $(whoami) != root ]; then
|
|
|
|
echo "[E] Run as root!"
|
|
|
|
kill 2
|
|
|
|
else
|
|
|
|
case $1 in
|
2021-08-25 12:37:56 +03:00
|
|
|
# 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} ;;
|
|
|
|
|
2021-08-24 08:32:32 +03:00
|
|
|
esac
|
|
|
|
fi
|