6 pacmanlog
=$
(pacman
-Qv |
grep "Log File" | cut
-d ":" -f2)
10 # Check and mount pacman database
11 stat_busy
"Mounting the pacman database"
13 echo "[ $(date "+%Y-
%m-
%d
%H
:%M
")] Pacman-cage [rc] >> Mounting the pacmans database" >> ${pacmanlog}
14 /sbin
/e2fsck
-p /var
/lib
/pacman.db
>/dev
/null
18 echo "WARNING: PACMAN DATABASE FILESYSTEM CHECK FAILED, NOT MOUNTED"
21 echo "[ $(date "+%Y-
%m-
%d
%H
:%M
")] Pacman-cage [rc] >> WARNING: Pacman database filesystem check failed, not mounted!" >> ${pacmanlog}
23 mount
-o loop
-t ext2
/var
/lib
/pacman.db
/var
/lib
/pacman
27 echo "WARNING: MOUNTING PACMAN DATABASE FAILED"
30 echo "[ $(date "+%Y-
%m-
%d
%H
:%M
")] Pacman-cage [rc] >> WARNING: Mounting of the pacman database failed!" >> ${pacmanlog}
35 echo "[ $(date "+%Y-
%m-
%d
%H
:%M
")] Pacman-cage [rc] >> Pacman database successfully mounted." >> ${pacmanlog}
41 stat_busy
"Unmounting the pacman database"
42 umount
/var
/lib
/pacman
>/dev
/null
2>&1
45 echo "[ $(date "+%Y-
%m-
%d
%H
:%M
")] Pacman-cage [rc] >> WARNING: Umounting of the pacman database failed!" >> ${pacmanlog}
51 echo "[ $(date "+%Y-
%m-
%d
%H
:%M
")] Pacman-cage [rc] >> Pacman database successfully unmounted." >> ${pacmanlog}
62 echo "usage: $0 {start|stop|restart}"