1
0
mirror of https://github.com/elisspace/rtinst.git synced 2026-08-29 23:52:13 +00:00
Files
rtinst/scripts/rtgetscripts
2017-06-21 22:05:40 +01:00

42 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
######################################################################
#
# Copyright (c) 2015 arakasi72 (https://github.com/arakasi72)
#
# --> Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
#
######################################################################
PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/sbin
if [ "$(id -u)" != "0" ]; then
echo "Must be run as root, directly or with sudo"
exit 1
fi
if [ ! -d /etc/rtinst ]; then
git clone https://github.com/arakasi72/rtinst.git /etc/rtinst
fi
cd /etc/rtinst
#if [ $(git name-rev --name-only --tags HEAD) != undefined ]; then
# echo "This is a tagged release and can't be updated"
# echo "Run rtsetup if you wish to switch to the master build"
# exit
#fi
branch=$(git symbolic-ref --short HEAD)
if [ $(git ls-remote --heads https://github.com/arakasi72/rtinst.git $branch | wc -l) -eq 0 ]; then
echo "$branch no longer appears to exist"
echo "run rtsetup to reset branch"
else
git fetch --all
git reset --hard origin/$branch
git pull origin $branch
ln -sf /etc/rtinst/scripts/* /usr/local/bin
ln -sf /etc/rtinst/rtsetup /usr/local/bin
fi