added various bash scripts

This commit is contained in:
Gitea 2018-11-24 03:29:01 -05:00
parent 08015f7736
commit 51cee7f68e
3 changed files with 31 additions and 0 deletions

19
chroot-fix.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
HDPART=/dev/sdb2
FS=ext4
CHDIR=/mnt/root
# Mount the root partition
sudo mount $HDPART -t $FS $CHDIR -o noatime,nodiratime
# Various needed pseudo fs dirs
sudo mount --bind /dev $CHDIR/dev
sudo mount --bind /proc $CHDIR/proc
sudo mount --bind /sys $CHDIR/sys
# Uncomment to include /home
#sudo mount --bind /home $CHDIR/home
# Extra mounts
#sudo mount --bind /mnt/data $CHDIR/mnt/data

10
fixperm.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
DIR=/var/www
USER=www-data
GROUP=$USER
sudo chown -R $USER:$GROUP $DIR
sudo find $DIR -type f -exec chmod 664 {} \;
sudo find $DIR -type d -exec chmod 775 {} \;
sudo find $DIR -type d -exec chmod g+s {} \;

2
ps3bat.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
upower -i `upower -e | grep sony` | grep percentage