You are not logged in.
#Following my previous post in a wrong forum ^.^ : http://bbs.archlinux.org/viewtopic.php?id=55965
#This post is about a complete rewrite of the previous script.
What is it all about?
Like many archers after two three system installs i got tired of remembering what packages i use, what changes i made to the configuration
files etc..
So i mad a script to automate the task (a lousy one to, check it out in the previous post if you want).
And this post includes a complete rewrite of the original script to actually be useful for everybody.
Who is it aimed at?
Anyone who doesn't want to store a big backup of his system but rather a handful of config files and this script (on my comp its less then 10mb),
it wont be useful to new users, you first need to know what you want to be on your system and possibly have ready config files.
How does the script work
A detailed explanation can be found in the config files, to cut it short the script is the ombination of three files, "tweaker", "tweaker.subscript"
and tweaker.conf.
tweaker is the core it basiclly react to the configuration files, unless you want to change fundamental stuff in the script, there is no need to change
anything in there, what the core does is, install predefined packages, including AUR with yaourt, adds users, help you configure alsa if you want,
copies config files you saved for reuse, initiates visudo if you want, and writes a log file, and you custom instructions file, plus anything you add to
the subscript
tweaker.conf is the configuration file, it lets you configure all the script does, the key feaute (and bug ) is the ability (and need) to create a profile
for each computer you use, meaning that by executing the script with the profile name as an argument would install only the thing and add users
that are relevant to the computer its configuring
tweaker.subscript is an empty script file that tweaker reads before it ends, allowing you to add any custom option you want without the need
to change the core
Possible problems
I'm even worse at documenting than scripting, i wrote a lot and tried to explain and i hope people can understand, in any case if you liked the script
and you are good with documentation please help out
I'm also new to scripting so some stuff might be implented in a lame way, if you have any advice please share
I don't have any file hosting access so you will have to copy paste from this thread for now, any help with that matter is much appreciated
Contact info
Send me a mail to vleon1@gmail.com
Please comment on this topic if you liked this script and want to use it, if the script will be popular enough ill add it to the wiki or something
General usage instructions
All the files should be in the same directory with the righ names (example files are not important and can be or not be anywhere)
The script should be run from it directory "cd /dir/of/script"
You should configure before running! and run only on a clean new system..
I advice to keep the script on some small media like a usb stick
You can find the updated script on a later post by me
Last edited by Black Mage (2008-10-03 16:59:21)
Offline
i just took a quick glance, but i suggest sth:
replace nano in echo_edit with a configurable variable
i'll probably use it once i get a newer laptop
☃ Snowman ☃
Offline
ok i will do it.
i just want to actually test and use this script first (will do this today or tommorow) and the ill just update all
at once, add $editor, and any other good suggestion ill get here or in my mail box.
thanks for the comment !
Offline
Great work! I was thinking of writing something like that for myself, so now I've got a good point to start from.
I'd suggest that you add an option for the end-user to replace "nano-ing" and "visudo-ing" (yes, I know, that it's unsafe) with his own scripts, and also - an option to make the script less verbose and interactive ("| yes" won't help in this particular case, I suppose).
For example, if this is not the first time when I install Arch on the machine, I know for sure what to add to sudoers, rc.conf, how to configure mixer and so on. All I want - is to review the config files, before I reboot the PC and to have an option to revert them if something goes wrong.
Well, I suppose, when you improve the script a bit - you should submit it to AUR.
Offline
adding users to groups would be nice too!
☃ Snowman ☃
Offline
can you please tell me whats, visudo-ing and nano-ing? i have no idea ^^
about the less verbose ill add a verbose option in the config.
and i think that i need a storage place forthe script to add it to aur.
Offline
can you please tell me whats, visudo-ing and nano-ing? i have no idea ^^
Well, I mean 'invoking visudo' and 'invoking nano' ))
and i think that i need a storage place forthe script to add it to aur.
No, you don't. You can pack both the script and PKGBUILD into a tarball. And in PKGBUILD you just need to set 'source=()'.
Offline
robmaloy: i just noticed your message, it was already implanted in the script, just check the example
added an option to change the nano editor
added the option to disable most of the scripts promp
Mr.Cat i didnt remember how you actually use another editor for sudo, but if you do remember please tell me
how and i will implent it.
There is a possible bug i didnt have the option to debug:
for some reason the X11 folder copied as x11, i did have so other folders with uppercase letters that copied fine.
and i made sure the original folder is X11 not x11.
this happened when i was running the script from a vfat formatted usb stick
if you reproduce this problem please let me know, and tell me if from what device it was copied and what was the fs type
also i you did not have this problem especially if you also use a usb stick formatted as vfat then please let me know
here are the new files:
tweaker:
#!/bin/bash
# Copyright 2008 Leon Vayman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# A copy of the GNU General Public License is found in
# <http://www.gnu.org/licenses/>.
#----Variables defination----#
comp="$1"
pkgmanager="pacman"
pkgoptions=" "
no_confirmation="no"
pkg_install_log=""
. ./tweaker.conf
#----General script functions----#
echo_edit()
{
echo ; clear
echo -en "$1 "
if [ "$no_confirmation" = "yes" ] ; then
read
fi
if [ "$2" != "" ] ; then
nano $2
fi
}
yes_no()
{
while [ 1 ] ; do
echo ; clear
echo -en "$1 (y/n) "
read Keypress
case "$Keypress" in
[Yy])
$2
break
;;
[Nn])
$3
$4
;;
*)
;;
esac
done
}
#----Usage test----#
if [ -z "$comp" ] ; then
yes_no "You are running the script with no arguments, if you havent configured the tweaker.conf file, select \"n\"\nand do it now, running the script with no arguments will only use general config, are you sure?" "" "echo Try again then :)" "exit"
else
yes_no "Are you running the script with the argument \"$comp\", is that correct?" "" "echo good thing you noticed :)" "exit"
fi
#----Check that the user updated the kernel and restarted before proceeding----#
yes_no "Have you already used pacman -Syu and Restarted?" "" "echo Then do it now.." "exit"
#----Adding archlinux.fr if its needed----#
if [ "$yaourt" = "yes" ] ; then
pkgmanager="yaourt"
echo -e "\n[archlinuxfr]\nServer = http://repo.archlinux.fr/i686\n#Change the above \"i686\" to \"x86_64\" if you are using arch64" >> /etc/pacman.conf
echo_edit "You are about to edit pacman.conf because a repository was added for yaourt, dont forget that\nyou might overwrite pacman.conf later with a file you prepared, make sure it will have the\narchlinux.fr repository as well.." "/etc/pacman.conf"
fi
#----Remove last error log if i exists----#
if [ -e /var/log/ErrorsSysInstall.log ] ; then
rm /var/log/ErrorsSysInstall.log
fi
#----Install all packages----#
echo_edit "Installing packages..\n"
if [ "$no_confirmation" = "yes" ] ; then
pkgoptions=" --noconfirm"
fi
if [ "$use_pkg_install_log" = "yes" ] ; then
if [ -e /var/log/PackageSysInstall.log] ; then
rm /var/log/PackageSysInstall.log
fi
pkg_install_log="| tee -a /var/log/PackageSysInstall.log"
fi
pacman -Syu
if [ "$pkgmanager" = "yaourt" ] ; then
pacman$pkgoptions -S yaourt $pkg_install_log
fi
if [ ! -z "$regular_packages" ] ; then
$pkgmanager$pkgoptions -S $regular_packages $pkg_install_log
fi
for pack in $group_packages ; do
pacman$pkgoptions -S $pack $pkg_install_log
done
if [ "$pkgmanager" = "yaourt" ] ; then
for pack in $aur_packages ; do
yaourt$pkgoptions -S $pack $pkg_install_log
done
fi
eval comp_regular_packages="\$${comp}_regular_packages"
eval comp_group_packages="\$${comp}_group_packages"
eval comp_aur_packages="\$${comp}_aur_packages"
if [ ! -z "$comp_regular_packages" ] ; then
$pkgmanager$pkgoptions -S $comp_regular_packages $pkg_install_log
fi
for pack in $comp_group_packages ; do
pacman$pkgoptions -S $pack $pkg_install_log
done
if [ "$pkgmanager" = "yaourt" ] ; then
for pack in $comp_aur_packages ; do
yaourt$pkgoptions -S $pack $pkg_install_log
done
fi
if [ "$no_confirmation" = "no" ] ; then
echo -en "\nPress Enter to continue"
read
fi
#----Add users----#
my_useradd()
{
echo ; clear
eval this_user="\$${1}"
echo "Adding User $1"
useradd $this_user
echo "Set $1 password"
passwd $1
echo ; clear
}
if [ ! -z "$comp" ] ; then
eval users="\$${comp}_users"
fi
for usr in $users ; do
my_useradd "$usr"
done
#----Configure alsa----#
if [ "$config_alsa" = "yes" ] ; then
test=1
echo_edit "Edit alsamixer"
while [ "$test" = 1 ] ; do
alsamixer -V all
echo ; clear
echo "Testing Sound"
aplay /usr/share/sounds/alsa/Noise.wav
if [ "$no_confirmation" = "no" ] ; then
yes_no "Did You Hear Any Sound?" "export test=0" "break"
fi
done
alsactl store
echo_edit "Make sure you add alsa to daemons "
fi
#----Copy the files from the "comp" folder----#
if ( [ -e ./$comp ] && [ ! -z $comp ] ) ; then
cp -r ./$comp/* /
echo_edit "File copy completed"
else
if [ -z $comp ] ; then
echo_edit "Using general configurations, no files copied"
else
echo_edit "You didnt create a \"$comp\" directory, no files copied!!" | tee -a /var/log/ErrorsSysInstall.log
fi
fi
#----Edit visudo----#
if [ "$run_visudo" = "yes" ] ; then
echo_edit "You are about to edit the sudoers file"
visudo
fi
#----Initiate tubscript----#
. ./tweaker.subscript
#----Write the logfile----#
if [ "$use_log" = "yes" ] ; then
if [ ! -z "$comp" ] ; then
eval log_user="\$${comp}_log_user"
fi
if [ -e /home/$log_user/ ] ; then
echo "$the_log" > /home/$log_user/PostInstall.txt
else
echo_edit "/home/$log_user/ doesnt exist, no log created!" | tee -a /var/log/ErrorsSysInstall.log
fi
fi
#----End----#
echo_edit "Install Finished, additional instructions where created in /home/$log_user/PostInstall.txt"
exit
tweaker.conf
# Copyright 2008 Leon Vayman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# A copy of the GNU General Public License is found in
# <http://www.gnu.org/licenses/>.
#------USAGE EXPLANATION-------#
#--1--
#A term that pop a lot in this script is "comp" its a short for computer
#name, if you have more than one computer and/or dual boots of different arch
#systems, you would probably want to use different configurations for the
#different setups, when you run this script you would specify the name of
#your setup as an argument (it can be any name you want "games-machine" "kitty"
#"fat-wolly" whatever you want), if you dicided on "main" for example it would
#look like that: ./tweaker main
#this means that every time that the script needs computer specific orders
#it would look for orders starting with "main" in the config file and would use
#them if they are availble.
#the script also expects to have general configurations that would apply
#to any anyone running the script (the comp specific configuration are appended
#to the general configs.
#--2--
#For a general run of the script pass no arguments, like that: /tweaker
#the script will use the general setting only.
#its recommended to create one profile rather than use this option
#it a lot more limited.
#--3--
#As a rule examples are provided with comments, when there is an option that is
#not commented it has to exist with an argument it can accept, dont comment or
#delete uncommented lines!
#--4--
#Note that the script creates two files /var/log/PackageSysInstall.log and
#/var/log/ErrorsSysInstall.log, check them out after usage to make sure
#everything went well
#--5--
#Read file config section!
#------GENERAL OPTIONS-------#
#Change the editor, right now the editor is only used once when you check yaourt="yes",
#to add the archlinux.fr repository (name of the editor, only editors you have before
#package installation so its probably vi, nano or ed :P)
script_editor="nano"
#"Yes" is not recommended unless its at least your second run of the script on this comp
#and you know what you are doing, it will disable pacman's and yaourt confirmation messages
#wich wouldnt allow you to edit aur packages if you have them!
#It will also disable all the prompt messages in the script, note that most of those messages
#come after the package installation (the proccess that takes 99.9% of the scripts time)
#and would just meant that instead the script stoping to prompt to you that you are going
#to edit alsamixer or visudo, it will stop when it will enter the editing mode, something
#that can confuse.
#to conclude it, its only relevant if you know the script will run fluently, and you are
#not going to edit alsa or visudo. (yes/no).
no_confirmation="no"
#This option will decide if package installation output will be written to
#/var/log/PackageSysInstall.log, if you chose "yes" you will have a file to look at and make
#sure everything in package install went well, the only problem is that you wont get the output
#of the packages downloads, "yes" is best used with no_confirmation="yes"
use_pkg_install_log="no"
#------PACKAGE CONFIGURATION-------#
#Do you want to install and use yaourt during package installation (yes/no)?
yaourt="yes"
#A list of the regular packages you want to install separated by white spaces and/or newlines
#regular-packages=""
regular_packages=""
#A list of package groups you want to install separated by white spaces and/or newlines
#leave empty brackets if you dont need any groups.
group_packages=""
#A list of the AUR packages you want to install separated by white spaces and/or newlines
#will be ignored if you checked "yaourt="no""
#aur-packages=""
aur_packages=""
#If you use more than one computer you can add special profiles here which will install
#additional packages for the specific computer by appending the profile name to the package
#type, seperated by the "_" symbol, for example:
#main_Gpackages="xfce4"
#In the example above if you execute the script with "main" as an argument
#like that: ./install main
#then the group xfce4 will be installed as well
#check example
#Specify every user you would use with his/her username="useradd arguments" for more information man useradd
#check example
#Specify a general user set, this setting would only be used when running the script without arguments.
users=""
#Specify a user set for each "comp".
#check example
#------OTHER OPTIONS-------#
#Do you want to manually configure alsa? (yes/no)
config_alsa="yes"
#Do you want to run visudo to configure sudo? (yes/no)
run_visudo="yes"
#------FILE HANDLING-------#
#To keep the code of the script simple, it alters your configuration files by copying modified files on top
#of the corrent ones, think of it as a chrooted enviormant, in the working directory of the script "./"
#you will create a directory named after every "comp" you want to use.
#Each directory will host the files you want to copy to the new "comp", how the files would be placed is
#better explained with an example.
#Suppose we use the "comp" "main", the script is run like that: ./tweaker main
#you already know that this "comp" will have speciffic package and user configurations, you will also
#have a directory named "main" in you working dear "./main"
#you want the file rc.conf that you preconfigured to fit the installed packages in the system.
#In the host system rc.conf should be copied to /etc/rc.conf, this means that in the "./main" folder
#the rc.conf file that will be copied should be in "./main/etc/rc.conf", just like chroot.
#this possibly means that you will create more folders than files, but assuming that you keep the
#script files and the directories you created in a constant place like a usb stick, this one time
#work will worth it.
#Note that general install's (script run without arguments) wouldnt copy files..
#Note on a dual boot system with two arch's it would be unwise to include menu.lst and fstab if you
#did not partition ahead (in other words if you are going to resize you partition and add another arch
#install, you will probably break have an irelevant copy of the two files copied to the new install
#------LOG FILE------#
#This one is actually very important, there are some things that you cant do in a command line interface
#for example run graphical configuration programms for some apps.
#If you want to finish your system and never worry about it again (unless you forgot to put something here :P)
#then you can write some comments to your log file with further manual instructions.
#Should a log file be created? (yes/no)
use_log="yes"
#A user for each generall install that gets the log file
log_user="vleon"
#A user for each comp that gets the log file
#check example
#Write you instructions beetwen the quotes
the_log=""
tweaker.conf.example
# Copyright 2008 Leon Vayman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# A copy of the GNU General Public License is found in
# <http://www.gnu.org/licenses/>.
#------USAGE EXPLANATION-------#
#--1--
#A term that pop a lot in this script is "comp" its a short for computer
#name, if you have more than one computer and/or dual boots of different arch
#systems, you would probably want to use different configurations for the
#different setups, when you run this script you would specify the name of
#your setup as an argument (it can be any name you want "games-machine" "kitty"
#"fat-wolly" whatever you want), if you dicided on "main" for example it would
#look like that: ./tweaker main
#this means that every time that the script needs computer specific orders
#it would look for orders starting with "main" in the config file and would use
#them if they are availble.
#the script also expects to have general configurations that would apply
#to any anyone running the script (the comp specific configuration are appended
#to the general configs.
#--2--
#For a general run of the script pass no arguments, like that: /tweaker
#the script will use the general setting only.
#its recommended to create one profile rather than use this option
#it a lot more limited.
#--3--
#As a rule examples are provided with comments, when there is an option that is
#not commented it has to exist with an argument it can accept, dont comment or
#delete uncommented lines!
#--4--
#Note that the script creates two files /var/log/PackageSysInstall.log and
#/var/log/ErrorsSysInstall.log, check them out after usage to make sure
#everything went well
#--5--
#Read file config section!
#------GENERAL OPTIONS-------#
#Change the editor, right now the editor is only used once when you check yaourt="yes",
#to add the archlinux.fr repository (name of the editor, only editors you have before
#package installation so its probably vi, nano or ed :P)
script_editor="nano"
#"Yes" is not recommended unless its at least your second run of the script on this comp
#and you know what you are doing, it will disable pacman's and yaourt confirmation messages
#wich wouldnt allow you to edit aur packages if you have them!
#It will also disable all the prompt messages in the script, note that most of those messages
#come after the package installation (the proccess that takes 99.9% of the scripts time)
#and would just meant that instead the script stoping to prompt to you that you are going
#to edit alsamixer or visudo, it will stop when it will enter the editing mode, something
#that can confuse.
#to conclude it, its only relevant if you know the script will run fluently, and you are
#not going to edit alsa or visudo. (yes/no).
no_confirmation="no"
#This option will decide if package installation output will be written to
#/var/log/PackageSysInstall.log, if you chose "yes" you will have a file to look at and make
#sure everything in package install went well, the only problem is that you wont get the output
#of the packages downloads, "yes" is best used with no_confirmation="yes"
use_pkg_install_log="no"
#------PACKAGE CONFIGURATION-------#
#Do you want to install and use yaourt during package installation (yes/no)?
yaourt="yes"
#A list of the regular packages you want to install separated by white spaces and/or newlines
regular_packages="abiword alsa-lib alsa-utils alsa-oss bash-completion cabextract centerim
comical conky exaile hal epdfview feh freetype2 gamin gconf-editor geany gksu
gmrun gnome-icon-theme gpicview gtk-engines zip irssi links-g libdvdcss tcl
lxappearance lxpanel lxde-common lxrandr lxtask mesa moc mousepad mplayer-plugin
numlockx openbox obconf obmenu openbox-themes p7zip pcmanfm pidgin pm-utils
powertop screen terminal ttf-bitstream-vera ttf-dejavu ttf-freefont ttf-ms-fonts
xorg-fonts-type1 unace unrar unzip xarchiver xchat xmahjongg python-sexy
perl-compress-zlib perl-crypt-blowfish perl-freezethaw perl-gtk2-sexy python-sexy
subversion"
#A list of package groups you want to install separated by white spaces and/or newlines
#leave empty brackets if you dont need any groups.
group_packages="xorg gstreamer0.10-plugins"
#A list of the AUR packages you want to install separated by white spaces and/or newlines
#will be ignored if you checked "yaourt="no""
aur_packages="checkgmail-svn stjerm ekiga3"
#If you use more than one computer you can add special profiles here which will install
#additional packages for the specific computer by appending the profile name to the package
#type, seperated by the "_" symbol, for example:
#main_Gpackages="xfce4"
#In the example above if you execute the script with "main" as an argument
#like that: ./install main
#then the group xfce4 will be installed as well
#main
main_regular_packages="flashplugin-beta cpufrequtils epiphany catalyst deluge amule xmoto abs samba jre"
main_aur_packages="icecat xcompmgr-git ov51x-jpeg vlc-branch brasero-no-gnome"
#game
game_regular_packages="catalyst xmoto abs"
game_aur_packages="icecat ov51x-jpeg vlc-branch brasero-no-gnome"
#laptop
laptop_regular_packages="vlc keytouch keytouch-editor xf86-video-i810 synaptics cpufrequtils
flashplugin-beta jre"
laptop_aur_packages="swiftweasel-pentium-3 wpa_supplicant-beta xcompmgr-git"
#Specify every user you would use with his/her username="useradd arguments" for more information man useradd
vleon="-d /home/vleon -g users -G disk,wheel,games,video,audio,optical,storage,power,dbus,hal,avahi,log -m vleon"
masha="-d /home/masha -g users -G disk,wheel,games,video,audio,optical,storage,power,dbus,hal,avahi,log -m masha"
#Specify a general user set, this setting would only be used when running the script without arguments.
users="vleon masha"
#Specify a user set for each "comp".
main_users="vleon moshe"
game_users="haim"
laptop_users="masha"
#------OTHER OPTIONS-------#
#Do you want to manually configure alsa? (yes/no)
config_alsa="yes"
#Do you want to run visudo to configure sudo? (yes/no)
run_visudo="yes"
#------FILE HANDLING-------#
#To keep the code of the script simple, it alters your configuration files by copying modified files on top
#of the corrent ones, think of it as a chrooted enviormant, in the working directory of the script "./"
#you will create a directory named after every "comp" you want to use.
#Each directory will host the files you want to copy to the new "comp", how the files would be placed is
#better explained with an example.
#Suppose we use the "comp" "main", the script is run like that: ./tweaker main
#you already know that this "comp" will have speciffic package and user configurations, you will also
#have a directory named "main" in you working dear "./main"
#you want the file rc.conf that you preconfigured to fit the installed packages in the system.
#In the host system rc.conf should be copied to /etc/rc.conf, this means that in the "./main" folder
#the rc.conf file that will be copied should be in "./main/etc/rc.conf", just like chroot.
#this possibly means that you will create more folders than files, but assuming that you keep the
#script files and the directories you created in a constant place like a usb stick, this one time
#work will worth it.
#Note that general install's (script run without arguments) wouldnt copy files..
#Note on a dual boot system with two arch's it would be unwise to include menu.lst and fstab if you
#did not partition ahead (in other words if you are going to resize you partition and add another arch
#install, you will probably break have an irelevant copy of the two files copied to the new install
#------LOG FILE------#
#This one is actually very important, there are some things that you cant do in a command line interface
#for example run graphical configuration programms for some apps.
#If you want to finish your system and never worry about it again (unless you forgot to put something here :P)
#then you can write some comments to your log file with further manual instructions.
#Should a log file be created? (yes/no)
use_log="yes"
#A user for each generall install that gets the log file
log_user="vleon"
#A user for each comp that gets the log file
main_log_user="vleon"
game_log_user="haim"
laptop_log_user="masha"
#Write you instructions beetwen the quotes
the_log="#------USAGE ADVICE-------#
Follow the instructions and delete the lines that are not relevant anymore.you can delete
this file after you finished.
Also you should read PackageSysInstall.log and /var/log/ErrorsSysInstall.log and make sure all went well.
#------NOTES-------#
1) Check the configure of the copied files to you computer, the full path's of the files
would equal the relative to this directory: \"./$comp/\", paths.
2) dont Forget to configure gksu after launching X
3) lauch and configure all the apps in the menu and the cmdline apps links -g, mocp,
irssi, centerim
4) configure keytouch on the laptop
5) test logout, reboot, shutdown and hibernate
6) run lxappearance, configure lxpanel and configure terminal
7) run sudo crontab -e if you have cron tasks
8) run powertop after you restart again with all the modules and daemons and other stuff
9) install ekiga3
10) on game make sure to handle /boot so that all systems cooperate
11) Use ln -s to link folders from users home to samba
12) X11 might copy as x11
13) Edit fstab and menu.lst
"
tweaker.subscript
# Copyright 2008 Leon Vayman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# A copy of the GNU General Public License is found in
# <http://www.gnu.org/licenses/>.
#This script is meant to be run only be tweaker itself, it will run at the end
#of the tweaker script adding any additional scripted command you might need.
#The reason for its existance is simple, it allows people to do things that
#the config file doesnt implent, without the need to mess in the original script.
#If you dont have use for such an option just leave this script blank.
tweaker.subscript.example
# Copyright 2008 Leon Vayman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# A copy of the GNU General Public License is found in
# <http://www.gnu.org/licenses/>.
#This script is meant to be run only be tweaker itself, it will run at the end
#of the tweaker script adding any additional scripted command you might need.
#The reason for its existance is simple, it allows people to do things that
#the config file doesnt implent, without the need to mess in the original script.
#If you dont have use for such an option just leave this script blank.
#If for some reason samba dir doesnt exist, create it
if [ ! -e /home/samba ] ; then
mkdir /home/samba
chown vleon:users /home/samba
chmod 770 /home/samba
fi
#Hide password from view and clean the system
if [ $comp = laptop ] ; then
chmod 600 /etc/wpa_supplicant.conf
chmod 600 /etc/fstab
rm -r /tmp/* /var/cache/pacman/pkg/* /var/abs/*
fi
#Set smbpasswd on main
if [ $comp = main ] ; then
echo "Set vleon's samba password"
smbpasswd -a vleon
echo ; clear
fi
#Return ownership to the approtiate users
chown -R vleon:users /home/vleon ; chown -R masha:users /home/masha
chmod /home/vleon 750 ; chmod /home/masha 750
chmod /home/vleon/.config 750 ; chmod /home/masha/config 750
chmod /home/vleon/.config/openbox 750 ; chmod /home/vleon/.config/openbox 750
Offline
awesome stuff mate
[home page] -- [code / configs]
"Once you go Arch, you must remain there for life or else Allan will track you down and break you."
-- Bregol
Offline
I may be necrobumping here, but just wanted to say I was planning to script something similar but did a quick search and bam! Thanks for saving me quite a bit of time.
Offline