OSDN Git Service

Add files via upload
authorksmt4699 <ksmt4699@gmail.com>
Mon, 22 Apr 2019 12:21:34 +0000 (21:21 +0900)
committerksmt4699 <ksmt4699@gmail.com>
Mon, 22 Apr 2019 12:21:34 +0000 (21:21 +0900)
NonFreeRepo/tools/addgpg.sh [new file with mode: 0644]
NonFreeRepo/tools/addpgp.sh [new file with mode: 0644]
NonFreeRepo/tools/addppa.sh [new file with mode: 0644]
NonFreeRepo/tools/noaddrepo.sh [new file with mode: 0644]

diff --git a/NonFreeRepo/tools/addgpg.sh b/NonFreeRepo/tools/addgpg.sh
new file mode 100644 (file)
index 0000000..1751f9b
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+#RootChesk
+if [[ ! $UID = 0 ]]; then
+    echo "You need root permission."
+    exit 1
+fi
+
+repo=$2
+channel=$3
+branch=$4
+group=$5
+key=$6
+pkgname=$7
+cd /tmp
+curl "$key" | gpg --dearmor > ${key##*/}
+install -o root -g root -m 644 ${key##*/} /etc/apt/trusted.gpg.d/
+echo 'deb "$repo" "$channel" "$branch"' > /etc/apt/sources.list.d/'$group'.list
+rm ${key##*/}
diff --git a/NonFreeRepo/tools/addpgp.sh b/NonFreeRepo/tools/addpgp.sh
new file mode 100644 (file)
index 0000000..5cd5b61
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+#isroot
+if [[ ! $UID = 0 ]]; then
+    echo "Please run the program at root."
+    exit 1
+fi
+addrepo(){
+    sudo sh -c "echo 'deb "$repo" "$channel" "$branch"' > /etc/apt/sources.list.d/'$group'.list"
+    wget -O - "$key" |sudo apt-key add -
+}
+for i in $@; do
+$i=$(echo $i|sed -e "s/-//")
+done
+repo=$2
+channel=$3
+branch=$4
+group=$5
+key=$6
+pkgname=$7
+addrepo
+sudo apt update
+sudo apt-get -y install $pkgname
+
diff --git a/NonFreeRepo/tools/addppa.sh b/NonFreeRepo/tools/addppa.sh
new file mode 100644 (file)
index 0000000..e40c021
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+repo=$1
+pkgname=$2
+sudo add-apt-repository -y "$repo"
+sudo apt update
+sudo apt -y install "$pkgname"
diff --git a/NonFreeRepo/tools/noaddrepo.sh b/NonFreeRepo/tools/noaddrepo.sh
new file mode 100644 (file)
index 0000000..05a7907
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+