melawy-skel-liveuser/liveuser/.local/userbin/key-sign.sh

68 lines
1.4 KiB
Bash
Raw Normal View History

2023-10-16 10:42:49 +05:00
#!/bin/bash
if [[ "$UID" != 0 ]]; then
echo "USER NOT ROOT"
2023-11-23 01:52:54 +05:00
sudo "$0"
2023-10-16 10:42:49 +05:00
exit
else
echo "USER IS ROOT"
fi
2023-11-23 01:02:49 +05:00
sleep 20
2023-10-16 10:42:49 +05:00
cd "/root"
2023-11-23 01:52:54 +05:00
mkdir -p /root/.gnupg 2>/dev/null
2023-11-22 22:03:00 +05:00
chmod 700 /root/.gnupg
2023-10-16 10:42:49 +05:00
haveged -w 1024
pacman-key --init
pkill haveged
pacman-key --populate archlinux melawy-linux endeavouros arcolinux chaotic cachyos
pacman-key --lsign-key melawy-linux
2023-11-22 22:03:00 +05:00
pacman-key --lsign-key endeavouros
2023-10-16 10:42:49 +05:00
pacman-key --lsign-key arcolinux
pacman-key --lsign-key chaotic
pacman-key --lsign-key cachyos
pacman-key --recv-keys valeria@fadeeva.me --keyserver hkps://keys.openpgp.org
pacman-key --lsign-key valeria@fadeeva.me
pacman-key --recv-keys key@fadeeva.me --keyserver hkps://keys.openpgp.org
pacman-key --lsign-key key@fadeeva.me
pacman-key --updatedb
2023-11-20 21:35:23 +05:00
pacman -Syy
2023-11-22 22:03:00 +05:00
2023-11-23 01:52:54 +05:00
title="Successed!"
msg="$(date '+%Y.%m.%d %H:%M:%S')"
users=$(/usr/bin/users | sed 's| |\n|g' | sort | uniq)
for user in $users
do
userid=$(/usr/bin/id -u "$user")
cmd=(
DISPLAY=:0
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$userid"/bus
/usr/bin/notify-send
--icon=face-smile
--urgency=low
-t 5000
-a "'Keys sign'"
"'$title'"
"'$msg'"
)
/usr/bin/su "$user" -c "${cmd[*]}"
if [ "$user" != "liveuser" ]; then
rm /home/"$user"/.config/autostart/key-sign.sh.desktop
rm /home/"$user"/.local/userbin/key-sign.sh
fi
done