Hits :
1969
#!/bin/sh
POINT="/arch64"
ID=`id -u`
function quit {
exit 1
}
function usage {
echo "usage: $0 -m/-u"
quit
}
function mount_point {
cd $POINT
mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
mount -t devpts pts dev/pts/
chroot . /bin/bash
}
function umount_point {
cd $POINT
umount proc/
umount sys/
umount dev/pts/
umount dev/
}
function check {
if [ "$1" == "-m" ]; then
mount_point $POINT
elif [ "$1" == "-u" ]; then
umount_point $POINT
else
usage
fi
}
# Check root
if [ "${ID}" -ne "0" ]; then
echo "Plz run this as root or via sudo. Thank you"
quit
fi
# Main
if [ $# -eq 1 ]; then
check $1
else
usage
fi