new package management helpenew package management helper
This commit is contained in:
parent
9c73145446
commit
2ac3d28115
30
aur-add
30
aur-add
@ -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
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo -u repo HOME=/data/repo local-repo repo -U
|
@ -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"
|
||||
|
@ -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
|
||||
|
2
lxc-log
2
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} "$@"
|
||||
|
14
lxc-makepkg
Executable file
14
lxc-makepkg
Executable file
@ -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 -- <<EOF
|
||||
set -ex
|
||||
cd "${DIR:-/}"
|
||||
aurrepo --sign
|
||||
makepkg --noconfirm "$@"
|
||||
aurrepo --sign
|
||||
EOF
|
14
package-add
Executable file
14
package-add
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
if [[ "$#" < 1 ]]; then
|
||||
echo "USAGE: $0 packages..."
|
||||
fi
|
||||
|
||||
for pkg in "$@"
|
||||
do
|
||||
cp -- "$pkg" "/data/containers/login/rootfs/var/lib/aurrepo/"
|
||||
name="$(basename $pkg)"
|
||||
lxc-attach -n login -- sudo -u aurrepo gpg --detach-sign --no-armor "/var/lib/aurrepo/$name"
|
||||
lxc-attach -n login -- pacman -U "/var/lib/aurrepo/$name"
|
||||
lxc-attach -n login -- sudo -u aurrepo aurrepo --sign --verbose
|
||||
done
|
@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# name of the volume
|
||||
zname=$(dirname $(dirname $(echo $2 | cut -b 2-)))
|
||||
|
||||
# name of the future snapshot
|
||||
bsname="$zname@rsnap-$(date +%F)"
|
||||
|
||||
sname=$bsname
|
||||
for i in 1 2 3 4 5
|
||||
do
|
||||
# exit if success
|
||||
zfs snapshot "$sname"
|
||||
if [ "x$?" == "x0" ]; then
|
||||
echo "backup started at $(date)" > $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
|
Loading…
Reference in New Issue
Block a user