-
Notifications
You must be signed in to change notification settings - Fork 0
/
restoredb.sh
22 lines (19 loc) · 912 Bytes
/
restoredb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
currentuser=$(users | awk '{print $1}')
## Restore KODI Database...
echo -e '\033[1;33mKODI Media Center... \033[1;34mRestoring database\033[0m'
rm -f -r /home/kodi/
cp -f -r ../kodicfg/. /home/
echo -e '\033[1;33mKODI Media Center... \033[1;34mUpdating user permissions\033[0m'
chmod -f -R 0777 /home/kodi/
echo -e '\033[1;33mKODI Media Center... \033[1;34mUpdating user ownership\033[0m'
chown -R root:root /home/kodi
## Restore USERS Database...
echo -e '\033[1;33mUser '$currentuser'... \033[1;34mRestoring database\033[0m'
rm -f -r /home/$currentuser/
cp -f -r ../homecfg/. /home/
rm -f -r /home/$currentuser/.config/pulse
echo -e '\033[1;33mUser '$currentuser'... \033[1;34mUpdating user permissions\033[0m'
chmod -f -R 0777 /home/$currentuser/
echo -e '\033[1;33mUser '$currentuser'... \033[1;34mUpdating user ownership\033[0m'
chown -R $currentuser:$currentuser /home/$currentuser