#!/bin/bash
+
+
+#RootChesk
+if [[ ! $UID = 0 ]];
+ echo "You need root permission."
+ exit 1
+fi
+
+
addrepo(){
- sudo sh -c "echo 'deb "$repo" "$channel" "$branch"' > /etc/apt/sources.list.d/'$group'.list"
+ sh -c "echo 'deb "$repo" "$channel" "$branch"' > /etc/apt/sources.list.d/'$group'.list"
wget -O - "$key" |sudo apt-key add -
}
ADD_LIST=("$@")
pkgname=$7
cd /tmp
curl "$key" | gpg --dearmor > ${key##*/}
- sudo install -o root -g root -m 644 ${key##*/} /etc/apt/trusted.gpg.d/
- sudo sh -c "echo 'deb "$repo" "$channel" "$branch"' > /etc/apt/sources.list.d/'$group'.list"
+ install -o root -g root -m 644 ${key##*/} /etc/apt/trusted.gpg.d/
+ sh -c "echo 'deb "$repo" "$channel" "$branch"' > /etc/apt/sources.list.d/'$group'.list"
$((i++))
shift 7;;
esac;shift
repo=$1
pkgname=$2
INSTALL_LIST=("$INSTALL_LIST[@]" "$pkgname")
- sudo add-apt-repository "$repo"
+ add-apt-repository "$repo"
$((i++))
shift 2
fi
done
-sudo apt update
+apt-get update
for install in ${INSTALL_LIST[@]}; do
- sudo apt install $install
+ apt-get install $install
done
-sudo apt autoremove
+apt-get -yf install
+apt-get -y autoremove