From 2ac3d281155179d5c2a5b86853bacf67a954aaff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 8 Sep 2015 22:40:33 +0000 Subject: [PATCH] new package management helpenew package management helper --- aur | 3 --- aur-add | 30 ------------------------------ aur-update | 3 --- backup-mysql | 2 +- decrypt-zfs | 1 + lxc-log | 2 +- lxc-makepkg | 14 ++++++++++++++ package-add | 14 ++++++++++++++ rsnapshot_cp_zfs | 23 ----------------------- 9 files changed, 31 insertions(+), 61 deletions(-) delete mode 100755 aur delete mode 100755 aur-add delete mode 100755 aur-update create mode 100755 lxc-makepkg create mode 100755 package-add delete mode 100755 rsnapshot_cp_zfs diff --git a/aur b/aur deleted file mode 100755 index d829328..0000000 --- a/aur +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -sudo -u repo HOME=/data/repo local-repo repo "$@" diff --git a/aur-add b/aur-add deleted file mode 100755 index 1e34e33..0000000 --- a/aur-add +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -for pkg in "$@"; do - if [ -e "$pkg" ]; then - pkg_archive="/tmp/$pkg" - cp "$pkg" "$pkg_archive" - sudo chown repo:repo "$pkg_archive" - shift - - name="$(pacman -Qi --file $pkg_archive | awk -e '/Name/ { print $3 } ')" - sudo -u repo HOME=/data/repo sh -c " - cd / - local-repo repo -r \"$name\" - local-repo repo -a \"$pkg_archive\" - " - - else - name="$@" - - sudo -u repo HOME=/data/repo sh -c " - cd / - local-repo repo -r \"$pkg\" - local-repo repo -A \"$pkg\" - " - fi - - [[ "$?" != "0" ]] && exit $? - echo Now you can install the package - echo \$ pacman -Sy $name -done diff --git a/aur-update b/aur-update deleted file mode 100755 index b22a575..0000000 --- a/aur-update +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -sudo -u repo HOME=/data/repo local-repo repo -U diff --git a/backup-mysql b/backup-mysql index 238f1ed..ac8c751 100755 --- a/backup-mysql +++ b/backup-mysql @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # TARGET: Backup-Ziel # IGNORE: Liste zu ignorierender Datenbanken (durch | getrennt) IGNORE="mysql|information_schema|performance_schema|test" diff --git a/decrypt-zfs b/decrypt-zfs index 3f8195d..d16db46 100755 --- a/decrypt-zfs +++ b/decrypt-zfs @@ -16,3 +16,4 @@ echo $password | cryptsetup luksOpen /dev/sda3 zfs_hd_1 echo $password | cryptsetup luksOpen /dev/sdb3 zfs_hd_2 zfs mount -a +mount -a diff --git a/lxc-log b/lxc-log index 7732521..9ea424b 100755 --- a/lxc-log +++ b/lxc-log @@ -25,4 +25,4 @@ CONTAINER_PATH="/data/containers/$CONTAINER" CGROUP="/system.slice/system-lxc.slice/lxc@${CONTAINER}.service/system.slice/${SERVICE}.service" UNIT=lxc@${CONTAINER}.service -journalctl _SYSTEMD_CGROUP=${CGROUP} + SYSLOG_IDENTIFIER=${SERVICE} _SYSTEMD_UNIT=${UNIT} "$@" +journalctl --system _SYSTEMD_CGROUP=${CGROUP} + SYSLOG_IDENTIFIER=${SERVICE} _SYSTEMD_UNIT=${UNIT} "$@" diff --git a/lxc-makepkg b/lxc-makepkg new file mode 100755 index 0000000..f91b3e2 --- /dev/null +++ b/lxc-makepkg @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ $EUID -ne 0 ]; then + echo "Must be root!" >&2 + exit 1 +fi + +lxc-attach --name login -- sudo -s -u aurrepo -- < $2/info - exit 0 - fi - # iterate over it if already exists - sname=$bsname-v$i -done - -echo ERROR zfs_cp: something is really broken -exit 1