On arrête d'être stupide et on échappe les commandes
Arrêt de la restauration si non superuser
This commit is contained in:
parent
414cf617ff
commit
3012af9c19
2 changed files with 17 additions and 8 deletions
|
@ -41,9 +41,14 @@ b="package_restore.sh"
|
|||
|
||||
echo "#! /bin/bash" > $b
|
||||
echo "" >> $b
|
||||
echo cp . /etc/apt/sources.list >> $b
|
||||
echo cp ./preferences.d/ /etc/apt/preferences.d/my_preferences >> $b
|
||||
echo cp -r ./sources.list.d/* /etc/apt/sources.list.d >> $b
|
||||
echo 'if [ $(id -u) -ne "0" ]; then' >> $b
|
||||
echo ' echo "Please execute with superuser privileges"' >> $b
|
||||
echo " exit -1" >> $b
|
||||
echo fi >> $b
|
||||
echo "" >> $b
|
||||
echo cp ./sources.list /etc/apt/sources.list >> $b
|
||||
echo cp ./preferences.d/my_preferences /etc/apt/preferences.d/my_preferences >> $b
|
||||
echo 'cp -r ./sources.list.d/* /etc/apt/sources.list.d' >> $b
|
||||
echo "" >> $b
|
||||
echo apt-get update >> $b
|
||||
echo apt-get install dselect >> $b
|
||||
|
@ -55,5 +60,4 @@ chmod u-x "$b"
|
|||
|
||||
cd -
|
||||
|
||||
exit
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue