BREAKING NEWS
Lazada Indonesia

Tips and Trick

Category 6

Category 7

March 13, 2010

Deep Freeze in Ubuntu

It's actually a trick that is very long, even now I do not know what this means can still be done ... hehehe ...
Understandably had twice Ubuntu codename change occurred since the first time I tried this, until Kang Wong Wong Weird formerly Reviewed Sugio ask for how to secure GNU / Linux like Windows with deepfreeze.
If the note is already developed Faronics deepfreeze for Linux, but still paid. It's worth considering the function and reliability so good. But what about those who do not have extra money to buy it, plowing? waduh was not his time to plow. Remember FOSS is developed in Indonesia so that we can slowly freed from sin piracy.

Ok, we immediately wrote to the point for the discussion of Linux-style deep freeze it. The concept of the trick is to protect the user's home folders in reply to protect, then create a script to extract reply to the original home folder. The script that I use of course not made my own pure, I got this script from Anjar Hardiena bang, frontman for the cafe with a linux distro zencafenya.

But the first time you run this script does not necessarily straight,'s known environment I use is Ubuntu, while those in the script that is zencafe that I think it was based slackware.Akhirnya after Oprek brain and right-and left-over assistance mbah google, I made script which I named Dippris.
In essence, this script provides two install and remove options. If installed, asked, where yg home folder to the protect. For example home folder for user "duck", then later sekrip save folder / home / test in / home / test.tar.gz. Also to update / etc / rc.local which is the command to delete / home / test and replace the extract dg / home / bebek.tar.gz. If Dippris uninstall, means the opposite, ie delete / home / bebek.tar.gz, and update / etc / rc.local.
Here scriptnya, good luck!
Oh yes, remember, this a try in ubuntu (most likely running on Debian-based distro) and make sure xdialog already installed. And who would run the Super User right user or root and chmod files Dippris at 755 (sudo chmod 755 Dippris). Ex: (assuming we're a folder script Dippris dg): "sudo chmod 755 Dippris" (without the quotes).


#!/bin/bash
# Dippris - Deepfreeze ala GNU/Linux
# Jangan lupa diback up, kalau salah ndak tangung jawab
# Copyleft 2007 by A. Hardiena
# Patched and modified for Ubuntu System by yellowhat89@gmail.com

Xdialog --title "Deepfreeze khas GNU/Linux" \
--menubox " Selamat datang di Dippris." 17 65 3 \
"Install" "Install Dippris" \
"Hapus" "Hapus/Remove Dippris" \
"Batal" "Batal/Abort Instalasi" 2>/tmp/checklist.tmp.$$

choice='cat /tmp/checklist.tmp.$$'
rm -f /tmp/checklist.tmp.$$

case $choice in
"Install")

ask='mktemp -q /tmp/menu.XXXXXX'
header="Deepfreeze ala Linux"
size="9 60"
content="Home folder yang mau di-protect?."
Xdialog --title "$header" --inputbox "$content" $size 2> $ask
if [ ! $?= 0 ]; then
exit 0
fi

directori='cat $ask'
check='cat /etc/rc.local | grep '# Deepfreeze System''
temporary="# Deepfreeze System"
if [ "$check" == "$temporary" ]; then
sed -i "/# Deepfreeze/d" /etc/rc.local
rm /home/$directori.tar.gz
fi
# Processing Deepfreeze and put to /etc/rc.local
cd /home/
rm $directori.tar.gz
tar -cf $directori.tar $directori
gzip --best $directori.tar
sed 's/exit 0//g' /etc/rc.local > /tmp/rc.local.tmp
mv /tmp/rc.local.tmp /etc/rc.local
chmod 755 /etc/rc.local
cat <<>> /etc/rc.local
# Deepfreeze System
cd /home/ # Deepfreeze do not manual editing this line
rm -Rf /home/$directori # Deepfreeze do not manual editing this line
tar -xvvzf /home/$directori.tar.gz -C /home/ # Deepfreeze do not manual editing this line
# Deepfreeze has ended here
exit 0

EOF
# Check if autorecovery has errorr
if [ $? = 0 ]; then
content="Deepfreeze home $directori success."
else
content="Deepfreeze home $directori failed."
fi

Xdialog --title "Header" --msgbox "$content" $size
;;
"Hapus")
ask='mktemp -q /tmp/menu.XXXXXX'
header="Deepfreeze ala Linux"
size="9 60"
content="Home folder you want to un-deepfreeze."
Xdialog --title "$header" --inputbox "$content" $size 2> $ask

if [ ! $? = 0 ]; then
exit 0
fi

directori='cat $ask'
sed -i "/# Deepfreeze/d" /etc/rc.local
rm /home/$directori.tar.gz
;;
esac

Post a Comment

 
Copyright © 2013 Just Scribble Hand
JSH