File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44#}
55
66## arg 1: the new package version
7- #post_install() {
8- # do something here
9- #}
7+ post_install() {
8+ for user in $(awk -F':' '{ if ($3 >= 1000 && $1 != "nobody") print $1 }' /etc/passwd); do
9+ if [ "$(systemctl is-active --user ydotool)" != "active" ];then
10+ sudo -u $user XDG_RUNTIME_DIR=/run/user/$(id -u $user) systemctl --user enable --now ydotool
11+ fi
12+ done
13+ }
1014
1115## arg 2: the old package version
1216#pre_upgrade() {
1317 # do something here
1418#}
1519
1620## arg 2: the old package version
17- # post_upgrade() {
18- # post_install
19- # }
21+ post_upgrade() {
22+ post_install
23+ }
2024
2125## arg 1: the old package version
2226#pre_remove() {
Original file line number Diff line number Diff line change 1+ ## arg 1: the new package version
2+ #pre_install() {
3+ # do something here
4+ #}
5+
6+ ## arg 1: the new package version
7+ post_install() {
8+ for user in $(awk -F':' '{ if ($3 >= 1000 && $1 != "nobody") print $1 }' /etc/passwd); do
9+ if [ "$(systemctl is-active --user ydotool)" != "active" ];then
10+ sudo -u $user XDG_RUNTIME_DIR=/run/user/$(id -u $user) systemctl --user enable --now ydotool
11+ fi
12+ }
13+
14+ ## arg 2: the old package version
15+ #pre_upgrade() {
16+ # do something here
17+ #}
18+
19+ ## arg 2: the old package version
20+ post_upgrade() {
21+ post_install
22+ }
23+
24+ ## arg 1: the old package version
25+ #pre_remove() {
26+ # do something here
27+ #}
28+
29+ ## arg 1: the old package version
30+ #post_remove() {
31+ # do something here
32+ #}
33+
You can’t perform that action at this time.
0 commit comments